summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/spawn.py
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2014-03-23 11:54:15 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2014-03-23 11:54:15 (GMT)
commita40675a1a232479bbc2cb9437db265416eeb5b2d (patch)
tree298062361b79c40489fbf9a20e2d3398ead87a1e /Lib/multiprocessing/spawn.py
parent75c5ab49edff23dacd1410062480c031afc80c9d (diff)
downloadcpython-a40675a1a232479bbc2cb9437db265416eeb5b2d.zip
cpython-a40675a1a232479bbc2cb9437db265416eeb5b2d.tar.gz
cpython-a40675a1a232479bbc2cb9437db265416eeb5b2d.tar.bz2
Issue #20990: Fix issues found by pyflakes for multiprocessing.
Diffstat (limited to 'Lib/multiprocessing/spawn.py')
-rw-r--r--Lib/multiprocessing/spawn.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/multiprocessing/spawn.py b/Lib/multiprocessing/spawn.py
index c8297f3..8dc48dd 100644
--- a/Lib/multiprocessing/spawn.py
+++ b/Lib/multiprocessing/spawn.py
@@ -64,7 +64,14 @@ def freeze_support():
Run code for process object if this in not the main process
'''
if is_forking(sys.argv):
- main()
+ kwds = {}
+ for arg in sys.argv[2:]:
+ name, value = arg.split('=')
+ if value == 'None':
+ kwds[name] = None
+ else:
+ kwds[name] = int(value)
+ spawn_main(**kwds)
sys.exit()
@@ -73,7 +80,8 @@ def get_command_line(**kwds):
Returns prefix of command line used for spawning a child process
'''
if getattr(sys, 'frozen', False):
- return [sys.executable, '--multiprocessing-fork']
+ tmp = ' '.join('%s=%r' % item for item in kwds.items())
+ return [sys.executable, '--multiprocessing-fork'] + tmp
else:
prog = 'from multiprocessing.spawn import spawn_main; spawn_main(%s)'
prog %= ', '.join('%s=%r' % item for item in kwds.items())