mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-76785: Fix interpreters.Queue.get_nowait() (gh-116166)
I missed this change in gh-115566.
This commit is contained in:
parent
a7549b03ce
commit
936d4611d6
2 changed files with 73 additions and 46 deletions
|
@ -215,10 +215,15 @@ class Queue:
|
|||
is the same as get().
|
||||
"""
|
||||
try:
|
||||
return _queues.get(self._id)
|
||||
obj, fmt = _queues.get(self._id)
|
||||
except _queues.QueueEmpty as exc:
|
||||
exc.__class__ = QueueEmpty
|
||||
raise # re-raise
|
||||
if fmt == _PICKLED:
|
||||
obj = pickle.loads(obj)
|
||||
else:
|
||||
assert fmt == _SHARED_ONLY
|
||||
return obj
|
||||
|
||||
|
||||
_queues._register_queue_type(Queue)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue