From 6a942528ecd0087b91a6c0a5fef5a57b307e7ca9 Mon Sep 17 00:00:00 2001 From: Richard Oudkerk Date: Fri, 25 May 2012 12:56:33 +0100 Subject: [PATCH] Issue #14881: Allow normal non-main thread to spawn a dummy process Fix suggested by Itay Brandes --- Lib/multiprocessing/dummy/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/multiprocessing/dummy/__init__.py b/Lib/multiprocessing/dummy/__init__.py index 19a3b697c29..e3b126e9796 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