summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2017-06-11 14:11:47 (GMT)
committerGitHub <noreply@github.com>2017-06-11 14:11:47 (GMT)
commitd24c8287e226ac9983caf6bb826a7b53142ee31f (patch)
treec041358ff6a9e78e64dc7e6cf3e5e0952ade5cd9 /Lib/asyncio
parentea8b34868c3a765ac9a5eed7321af8f4548a9654 (diff)
downloadcpython-d24c8287e226ac9983caf6bb826a7b53142ee31f.zip
cpython-d24c8287e226ac9983caf6bb826a7b53142ee31f.tar.gz
cpython-d24c8287e226ac9983caf6bb826a7b53142ee31f.tar.bz2
bpo-30508: Don't log exceptions if Task/Future "cancel()" method was called. (#2110)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/futures.py1
-rw-r--r--Lib/asyncio/tasks.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py
index 9ca8d84..60b0d313 100644
--- a/Lib/asyncio/futures.py
+++ b/Lib/asyncio/futures.py
@@ -240,6 +240,7 @@ class Future:
change the future's state to cancelled, schedule the callbacks and
return True.
"""
+ self._log_traceback = False
if self._state != _PENDING:
return False
self._state = _CANCELLED
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index 89d0989..6c43e68 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -208,6 +208,7 @@ class Task(futures.Future):
terminates with a CancelledError exception (even if cancel()
was not called).
"""
+ self._log_traceback = False
if self.done():
return False
if self._fut_waiter is not None: