summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2017-05-17 14:03:35 (GMT)
committerGitHub <noreply@github.com>2017-05-17 14:03:35 (GMT)
commit43d4c0329e2348540a3a16ac61b3032f04eefd34 (patch)
treee627eacc7a4d2678e9a248d6c506009b9cabc010 /Lib/multiprocessing
parentb769c91c2db304db44cd514344369cde1f8d9dc5 (diff)
downloadcpython-43d4c0329e2348540a3a16ac61b3032f04eefd34.zip
cpython-43d4c0329e2348540a3a16ac61b3032f04eefd34.tar.gz
cpython-43d4c0329e2348540a3a16ac61b3032f04eefd34.tar.bz2
bpo-30301: Fix AttributeError when using SimpleQueue.empty() (#1601) (#1628)
Under *spawn* and *forkserver* start methods, SimpleQueue.empty() could raise AttributeError due to not setting _poll in __setstate__.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/queues.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py
index dda03dd..a4f4ef8 100644
--- a/Lib/multiprocessing/queues.py
+++ b/Lib/multiprocessing/queues.py
@@ -337,6 +337,7 @@ class SimpleQueue(object):
def __setstate__(self, state):
(self._reader, self._writer, self._rlock, self._wlock) = state
+ self._poll = self._reader.poll
def get(self):
with self._rlock: