Skip to content

Commit b4ef4f5

Browse files
d-w-moorealanking
authored andcommitted
[#587] unique_name now hashes the call tuple for a random seed.
This will allow tests that depend on irods.test.helpers.unique_name to run in Python3.11+. The aforementioned hashing was internally and noiselessly performed in Python 3.8 and before, but was deprecated in 3.9 and then discontinued in 3.11. As a result, we'll now perform it ourselves.
1 parent 7c458ff commit b4ef4f5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

irods/test/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def f(session):
100100
session.resources.create( a_name, 'unixfilesystem', session.host, '/tmp/' + a_name )
101101
'''
102102
if not getattr(_thrlocal,"rand_gen",None) : _thrlocal.rand_gen = random.Random()
103-
_thrlocal.rand_gen.seed(seed_tuple)
103+
_thrlocal.rand_gen.seed(hash(seed_tuple))
104104
return '%016X' % _thrlocal.rand_gen.randint(0,(1<<64)-1)
105105

106106

0 commit comments

Comments
 (0)