From 7c1e2e256c4cb588d2e9a48f844a09d7ff185748 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 24 Nov 2018 10:07:47 +0100 Subject: [PATCH] os.urandom returns byte, not string in python3 --- processing/pre/seeds_fromRandom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/pre/seeds_fromRandom.py b/processing/pre/seeds_fromRandom.py index c1a7cbd4d..6ec221e25 100755 --- a/processing/pre/seeds_fromRandom.py +++ b/processing/pre/seeds_fromRandom.py @@ -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)