mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-30301: Fix AttributeError when using SimpleQueue.empty() (#1601)
Under *spawn* and *forkserver* start methods, SimpleQueue.empty() could raise AttributeError due to not setting _poll in __setstate__.
This commit is contained in:
parent
0774e79b93
commit
6f75bc003a
3 changed files with 40 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue