os.urandom returns byte, not string in python3

This commit is contained in:
Martin Diehl 2018-11-24 10:07:47 +01:00
parent 1d936fc5f2
commit 7c1e2e256c
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ options.fraction = np.array(options.fraction)
options.grid = np.array(options.grid)
gridSize = options.grid.prod()
if options.randomSeed is None: options.randomSeed = int(os.urandom(4).encode('hex'), 16)
if options.randomSeed is None: options.randomSeed = int(os.urandom(4).hex(), 16)
np.random.seed(options.randomSeed) # init random generators
random.seed(options.randomSeed)