mirror of
https://github.com/python/cpython.git
synced 2025-11-09 18:11:38 +00:00
[3.9] bpo-46672: fix NameError in asyncio.gather if type check fails (GH-31187) (GH-31441)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
cf1993210f
commit
a6116a980c
3 changed files with 22 additions and 1 deletions
|
|
@ -768,7 +768,7 @@ def _done_callback(fut):
|
|||
nonlocal nfinished
|
||||
nfinished += 1
|
||||
|
||||
if outer.done():
|
||||
if outer is None or outer.done():
|
||||
if not fut.cancelled():
|
||||
# Mark exception retrieved.
|
||||
fut.exception()
|
||||
|
|
@ -823,6 +823,7 @@ def _done_callback(fut):
|
|||
children = []
|
||||
nfuts = 0
|
||||
nfinished = 0
|
||||
outer = None # bpo-46672
|
||||
for arg in coros_or_futures:
|
||||
if arg not in arg_to_fut:
|
||||
fut = ensure_future(arg, loop=loop)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue