Commit cc772a9c authored by Denis Bilenko's avatar Denis Bilenko

Hub.cancel_wait: avoid scheduling a callback if not necessary

parent 2faec79f
......@@ -298,7 +298,8 @@ class Hub(greenlet):
watcher.stop()
def cancel_wait(self, watcher, error):
self.loop.run_callback(self._cancel_wait, watcher, error)
if watcher.callback is not None:
self.loop.run_callback(self._cancel_wait, watcher, error)
def _cancel_wait(self, watcher, error):
if watcher.active:
......
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