]> granicus.if.org Git - python/commitdiff
Close #19284: Handle -R properly in flag helper
authorNick Coghlan <ncoghlan@gmail.com>
Fri, 18 Oct 2013 12:39:50 +0000 (22:39 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Fri, 18 Oct 2013 12:39:50 +0000 (22:39 +1000)
Previously, the -R option would be specified multiple times
if PYTHONHASHSEED was set.

Lib/subprocess.py

index 4ce3c929d6b70ad082e47649cde19c72378854ce..23c9ea515b2d1f5632777b43507112f97507e54f 100644 (file)
@@ -506,6 +506,8 @@ def _args_from_interpreter_flags():
     for flag, opt in flag_opt_map.items():
         v = getattr(sys.flags, flag)
         if v > 0:
+            if flag == 'hash_randomization':
+                v = 1 # Handle specification of an exact seed
             args.append('-' + opt * v)
     for opt in sys.warnoptions:
         args.append('-W' + opt)