From: Richard Oudkerk Date: Fri, 25 May 2012 11:57:58 +0000 (+0100) Subject: Issue #14881: Allow normal non-main thread to spawn a dummy process X-Git-Tag: v3.3.0a4~74^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54454e7dc25f8ce5aef87a4faed89aca19067815;p=thirdparty%2FPython%2Fcpython.git Issue #14881: Allow normal non-main thread to spawn a dummy process Fix suggested by Itay Brandes --- diff --git a/Lib/multiprocessing/dummy/__init__.py b/Lib/multiprocessing/dummy/__init__.py index c4933d9ec539..101c3cba4d7d 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