Re-fix issue #19284: Don't generate the no-op -R command line
parameter to "enable" the always on sys.flags.hash_randomization in _args_from_interpreter_flags() used by multiprocessing and some unittests. This simplifies the code.
This commit is contained in:
parent
220ba72c20
commit
0212c4dc6b
@ -512,14 +512,11 @@ def _args_from_interpreter_flags():
|
|||||||
'verbose': 'v',
|
'verbose': 'v',
|
||||||
'bytes_warning': 'b',
|
'bytes_warning': 'b',
|
||||||
'quiet': 'q',
|
'quiet': 'q',
|
||||||
'hash_randomization': 'R',
|
|
||||||
}
|
}
|
||||||
args = []
|
args = []
|
||||||
for flag, opt in flag_opt_map.items():
|
for flag, opt in flag_opt_map.items():
|
||||||
v = getattr(sys.flags, flag)
|
v = getattr(sys.flags, flag)
|
||||||
if v > 0:
|
if v > 0:
|
||||||
if flag == 'hash_randomization':
|
|
||||||
v = 1 # Handle specification of an exact seed
|
|
||||||
args.append('-' + opt * v)
|
args.append('-' + opt * v)
|
||||||
for opt in sys.warnoptions:
|
for opt in sys.warnoptions:
|
||||||
args.append('-W' + opt)
|
args.append('-W' + opt)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user