diff -r c7ce67c9237a Lib/multiprocessing/forking.py --- a/Lib/multiprocessing/forking.py Thu Apr 28 17:27:59 2011 +0200 +++ b/Lib/multiprocessing/forking.py Wed May 18 18:24:18 2011 +0400 @@ -319,11 +319,36 @@ The "freeze_support()" line can be omitted if the program is not going to be frozen to produce a Windows executable.''') + flag_opt_map = { + 'debug': 'd', + 'py3k_warning': '3', + 'division_warning': 'Q', + 'division_new': 'Qnew', + 'inspect': 'i', + 'interactive': 'i', + 'optimize': 'O', + 'dont_write_bytecode': 'B', + 'no_user_site': 's', + 'no_site': 'S', + 'ignore_environment': 'E', + 'tabcheck': 't', + 'verbose': 'v', + 'unicode': 'U', + 'bytes_warning': 'b', + } + args = [] + for flag, opt in flag_opt_map.items(): + v = getattr(sys.flags, flag) + if v > 0: + args.append('-' + opt * v) + for opt in sys.warnoptions: + args.append('-W' + opt) + if getattr(sys, 'frozen', False): - return [sys.executable, '--multiprocessing-fork'] + return [sys.executable] + args + ['--multiprocessing-fork'] else: prog = 'from multiprocessing.forking import main; main()' - return [_python_exe, '-c', prog, '--multiprocessing-fork'] + return [_python_exe] + args + ['-c', prog, '--multiprocessing-fork'] def main():