]> granicus.if.org Git - python/commitdiff
Fixes issue #20954: _args_from_interpreter_flags used by multiprocessing
authorGregory P. Smith <greg@krypto.org>
Sun, 13 Dec 2015 21:57:50 +0000 (13:57 -0800)
committerGregory P. Smith <greg@krypto.org>
Sun, 13 Dec 2015 21:57:50 +0000 (13:57 -0800)
and some tests no longer behaves incorrectly in the presence of the
PYTHONHASHSEED environment variable.

Lib/subprocess.py
Misc/NEWS

index f9e9104d45736b6151cfc3225a63a6b17a7d3d76..4e7b0644a6bd21f5107d279e97162648954ba6d1 100644 (file)
@@ -498,7 +498,6 @@ def _args_from_interpreter_flags():
         'ignore_environment': 'E',
         'verbose': 'v',
         'bytes_warning': 'b',
-        'hash_randomization': 'R',
         'py3k_warning': '3',
     }
     args = []
@@ -506,6 +505,8 @@ def _args_from_interpreter_flags():
         v = getattr(sys.flags, flag)
         if v > 0:
             args.append('-' + opt * v)
+    if getattr(sys.flags, 'hash_randomization') != 0:
+        args.append('-R')
     for opt in sys.warnoptions:
         args.append('-W' + opt)
     return args
index c68e9c935b14013487b433ce1198ffc34414d10a..adb4a1556be0c95712eeb2c7af29c46e5aedcc38 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,6 +22,10 @@ Core and Builtins
 Library
 -------
 
+- Issue #20954: _args_from_interpreter_flags used by multiprocessing and some
+  tests no longer behaves incorrectly in the presence of the PYTHONHASHSEED
+  environment variable.
+
 - Issue #14285: When executing a package with the "python -m package" option,
   and package initialization raises ImportError, a proper traceback is now
   reported.