gh-76785: Fix interpreters.Queue.get_nowait() (gh-116166)

I missed this change in gh-115566.
This commit is contained in:
Eric Snow 2024-03-01 09:36:35 -07:00 committed by GitHub
parent a7549b03ce
commit 936d4611d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 73 additions and 46 deletions

View file

@ -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)