From 4c0a09a0c96d3027ccb4e395ac9bd9dae5db33f1 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Sun, 2 Aug 2015 16:49:31 -0400 Subject: [PATCH] Revert da29a94367b2 --- Lib/asyncio/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 45c6d1b0e03..9bfc1cf8147 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -249,8 +249,9 @@ class Task(futures.Future): result._blocking = False result.add_done_callback(self._wakeup) self._fut_waiter = result - if self._must_cancel and self._fut_waiter.cancel(): - self._must_cancel = False + if self._must_cancel: + if self._fut_waiter.cancel(): + self._must_cancel = False else: self._loop.call_soon( self._step, None,