mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
asyncio: Log an error if a Task is destroyed while it is still pending
This commit is contained in:
parent
4c945fe9e9
commit
a02f81ff17
4 changed files with 60 additions and 4 deletions
|
@ -169,6 +169,9 @@ class Future:
|
|||
res += '<{}>'.format(self._state)
|
||||
return res
|
||||
|
||||
# On Python 3.3 or older, objects with a destructor part of a reference
|
||||
# cycle are never destroyed. It's not more the case on Python 3.4 thanks to
|
||||
# the PEP 442.
|
||||
if _PY34:
|
||||
def __del__(self):
|
||||
if not self._log_traceback:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue