bpo-46796: Simplify handling of removed parameter "loop" in asyncio (GH-31431)

This commit is contained in:
Serhiy Storchaka 2022-02-21 13:25:52 +02:00 committed by GitHub
parent be095f6c32
commit 195a46d6ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 24 deletions

View file

@ -5,20 +5,10 @@ from . import events
_global_lock = threading.Lock()
# Used as a sentinel for loop parameter
_marker = object()
class _LoopBoundMixin:
_loop = None
def __init__(self, *, loop=_marker):
if loop is not _marker:
raise TypeError(
f'As of 3.10, the *loop* parameter was removed from '
f'{type(self).__name__}() since it is no longer necessary'
)
def _get_loop(self):
loop = events._get_running_loop()