diff options
author | Kumar Aditya <rahuladitya303@gmail.com> | 2021-12-07 05:10:35 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-07 01:40:35 +0200 |
commit | 265918bb1d782ab85c7dbc835eb62d6cfc2145b7 (patch) | |
tree | d3f63cd07b8465aed76dfc04839d388c28bf87c2 /Lib/asyncio/base_events.py | |
parent | 8518ee348c18da7e150f5e42b3424c86f7c0a3d8 (diff) | |
download | cpython-265918bb1d782ab85c7dbc835eb62d6cfc2145b7.tar.gz cpython-265918bb1d782ab85c7dbc835eb62d6cfc2145b7.zip |
bpo-23819: asyncio: Replace AssertionError with TypeError where it makes sense (GH-29894)
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r-- | Lib/asyncio/base_events.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 054d7b45ec2..cfaf082587b 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -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() |