]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
asyncio: __del__() keep reference to warnings.warn (GH-11491)
authorVictor Stinner <vstinner@redhat.com>
Thu, 10 Jan 2019 10:24:40 +0000 (11:24 +0100)
committerGitHub <noreply@github.com>
Thu, 10 Jan 2019 10:24:40 +0000 (11:24 +0100)
commitfb2c3465f09e1f720cdae7eca87d62125a327fd9
treea1cfdcf7ea81295f3a955bcdec2275b8e8967965
parent9b07681c09182d4b9d23cd52566a4992b8afecbb
asyncio: __del__() keep reference to warnings.warn (GH-11491)

* asyncio: __del__() keep reference to warnings.warn

The __del__() methods of asyncio classes now keep a strong reference
to the warnings.warn() to be able to display the ResourceWarning
warning in more cases. Ensure that the function remains available if
instances are destroyed late during Python shutdown (while module
symbols are cleared).

* Rename warn parameter to _warn

"_warn" name is a hint that it's not the regular warnings.warn()
function.
Lib/asyncio/base_events.py
Lib/asyncio/base_subprocess.py
Lib/asyncio/proactor_events.py
Lib/asyncio/selector_events.py
Lib/asyncio/sslproto.py
Lib/asyncio/unix_events.py
Lib/asyncio/windows_utils.py