Commit dc4bfc8a authored by Denis Bilenko's avatar Denis Bilenko

fix bug in Timeout.start_new: if passed a not yet started Timeout instance, start_new must start it

parent d8dcf49b
......@@ -86,6 +86,8 @@ class Timeout(BaseException):
@classmethod
def start_new(cls, timeout=None, exception=None):
if isinstance(timeout, Timeout):
if not timeout.pending:
timeout.start()
return timeout
timeout = cls(timeout, exception)
timeout.start()
......
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