]> granicus.if.org Git - python/commitdiff
Issue #14881: Allow normal non-main thread to spawn a dummy process
authorRichard Oudkerk <shibturn@gmail.com>
Fri, 25 May 2012 11:57:58 +0000 (12:57 +0100)
committerRichard Oudkerk <shibturn@gmail.com>
Fri, 25 May 2012 11:57:58 +0000 (12:57 +0100)
Fix suggested by Itay Brandes

Lib/multiprocessing/dummy/__init__.py

index c4933d9ec5396a525427cb3e889eddadd9cd64bf..101c3cba4d7d91431f9f4835536474e586624c54 100644 (file)
@@ -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