diff options
| author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-01-22 16:58:53 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-22 13:28:53 +0200 |
| commit | ea5b96842e066623a53015d8b2492ed61a5baf96 (patch) | |
| tree | 79b3a3f4d23698995899a6b8d3ce067856c30f58 /Lib/asyncio/futures.py | |
| parent | ab8fe22e5e4e282da8ea6f4e77f4c0a6616ec9c2 (diff) | |
| download | cpython-git-ea5b96842e066623a53015d8b2492ed61a5baf96.tar.gz | |
bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777)
* bpo-46469: Make asyncio generic classes return GenericAlias
* 📜🤖 Added by blurb_it.
* Update Misc/NEWS.d/next/Library/2022-01-22-05-05-08.bpo-46469.plUab5.rst
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Lib/asyncio/futures.py')
| -rw-r--r-- | Lib/asyncio/futures.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py index 10f8f0554e..8e8cd87612 100644 --- a/Lib/asyncio/futures.py +++ b/Lib/asyncio/futures.py @@ -8,6 +8,7 @@ import concurrent.futures import contextvars import logging import sys +from types import GenericAlias from . import base_futures from . import events @@ -106,8 +107,7 @@ class Future: context['source_traceback'] = self._source_traceback self._loop.call_exception_handler(context) - def __class_getitem__(cls, type): - return cls + __class_getitem__ = classmethod(GenericAlias) @property def _log_traceback(self): |
