summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/asyncio/tasks.py
diff options
context:
space:
mode:
authorarcadia-devtools <[email protected]>2022-03-18 09:10:23 +0300
committerarcadia-devtools <[email protected]>2022-03-18 09:10:23 +0300
commitfef2b3a8ed5955b63c71e8e541a5acf2e393925a (patch)
treee55d2882d5c2c71561a0aa89158ec174d81f92fd /contrib/tools/python3/src/Lib/asyncio/tasks.py
parent2acc0fc3cdc40434ea286f2fac62386e3fd9c19d (diff)
intermediate changes
ref:102662f6c42fba80d7bfd4a328124cbb4294be48
Diffstat (limited to 'contrib/tools/python3/src/Lib/asyncio/tasks.py')
-rw-r--r--contrib/tools/python3/src/Lib/asyncio/tasks.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/tools/python3/src/Lib/asyncio/tasks.py b/contrib/tools/python3/src/Lib/asyncio/tasks.py
index 27a3c8c5a88..53252f2079d 100644
--- a/contrib/tools/python3/src/Lib/asyncio/tasks.py
+++ b/contrib/tools/python3/src/Lib/asyncio/tasks.py
@@ -17,6 +17,7 @@ import itertools
import types
import warnings
import weakref
+from types import GenericAlias
from . import base_tasks
from . import coroutines
@@ -147,8 +148,7 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
self._loop.call_exception_handler(context)
super().__del__()
- def __class_getitem__(cls, type):
- return cls
+ __class_getitem__ = classmethod(GenericAlias)
def _repr_info(self):
return base_tasks._task_repr_info(self)
@@ -768,7 +768,7 @@ def _gather(*coros_or_futures, loop=None, return_exceptions=False):
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 _gather(*coros_or_futures, loop=None, return_exceptions=False):
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)