mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-23819: asyncio: Replace AssertionError with TypeError where it makes sense (GH-29894)
This commit is contained in:
parent
8518ee348c
commit
265918bb1d
5 changed files with 15 additions and 9 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue