diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2012-05-25 11:56:33 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2012-05-25 11:56:33 (GMT) |
commit | 6a942528ecd0087b91a6c0a5fef5a57b307e7ca9 (patch) | |
tree | fc60b6c1bc48f6d90548007a92c719afcc345365 /Lib/multiprocessing/dummy/__init__.py | |
parent | 877effc2986ad30ecd5454811b0449bcfe3037f5 (diff) | |
download | cpython-6a942528ecd0087b91a6c0a5fef5a57b307e7ca9.zip cpython-6a942528ecd0087b91a6c0a5fef5a57b307e7ca9.tar.gz cpython-6a942528ecd0087b91a6c0a5fef5a57b307e7ca9.tar.bz2 |
Issue #14881: Allow normal non-main thread to spawn a dummy process
Fix suggested by Itay Brandes
Diffstat (limited to 'Lib/multiprocessing/dummy/__init__.py')
-rw-r--r-- | Lib/multiprocessing/dummy/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/multiprocessing/dummy/__init__.py b/Lib/multiprocessing/dummy/__init__.py index 19a3b69..e3b126e 100644 --- a/Lib/multiprocessing/dummy/__init__.py +++ b/Lib/multiprocessing/dummy/__init__.py @@ -70,7 +70,8 @@ class DummyProcess(threading.Thread): def start(self): assert self._parent is current_process() self._start_called = True - self._parent._children[self] = None + if hasattr(self._parent, '_children'): + self._parent._children[self] = None threading.Thread.start(self) @property |