Commit d327559d authored by Denis Bilenko's avatar Denis Bilenko

use real assert in Timeout.start()

parent 483efb53
...@@ -88,8 +88,7 @@ class Timeout(BaseException): ...@@ -88,8 +88,7 @@ class Timeout(BaseException):
self.timer = None self.timer = None
def start(self): def start(self):
if self.pending: assert not self.pending, '%r is already started; to restart it, cancel it first' % self
raise AssertionError('%r is already started; to restart it, cancel it first' % self)
if self.seconds is None: # "fake" timeout (never expires) if self.seconds is None: # "fake" timeout (never expires)
self.timer = None self.timer = None
elif self.exception is None or self.exception is False: # timeout that raises self elif self.exception is None or self.exception is False: # timeout that raises self
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment