bpo-30508: Don't log exceptions if Task/Future "cancel()" method was called. (#2109)

This commit is contained in:
Yury Selivanov 2017-06-11 14:00:14 +00:00 committed by GitHub
parent 59422a29ee
commit 176f2ebdad
6 changed files with 49 additions and 1 deletions

View file

@ -191,6 +191,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