bpo-23819: asyncio: Replace AssertionError with TypeError where it makes sense (GH-29894)

This commit is contained in:
Kumar Aditya 2021-12-07 05:10:35 +05:30 committed by GitHub
parent 8518ee348c
commit 265918bb1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 9 deletions

View file

@ -706,6 +706,8 @@ class BaseEventLoop(events.AbstractEventLoop):
Any positional arguments after the callback will be passed to
the callback when it is called.
"""
if delay is None:
raise TypeError('delay must not be None')
timer = self.call_at(self.time() + delay, callback, *args,
context=context)
if timer._source_traceback:
@ -717,6 +719,8 @@ class BaseEventLoop(events.AbstractEventLoop):
Absolute time corresponds to the event loop's time() method.
"""
if when is None:
raise TypeError("when cannot be None")
self._check_closed()
if self._debug:
self._check_thread()