From 29922fc0d0f64d23d1d64bc35510a824dc9266af Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 4 Oct 2019 18:27:28 +0100 Subject: [PATCH] utils/t/bits-testgen.py: Set the `SEED' from the command-line correctly. This never stood a chance before, because `arg' always returned the script path. Now that's fixed, instead `int' complains that the hex number it's being given isn't acceptable. I can't fix this by explicitly passing a radix of 0 because that doesn't allow an existing integer object. So we have this circumlocution. --- utils/t/bits-testgen.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/t/bits-testgen.py b/utils/t/bits-testgen.py index 810b519..05e4baf 100644 --- a/utils/t/bits-testgen.py +++ b/utils/t/bits-testgen.py @@ -18,7 +18,9 @@ def arg(default = None): else: return default R.seed(None) -SEED = int(arg(R.randrange(0, 1 << 32))) +seed = arg() +if seed is None: SEED = R.randrange(0, 1 << 32) +else: SEED = int(seed, 0) R.seed(SEED) print '### Test vectors for 64-bit arithmetic macros' -- 2.11.0