diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-03-23 00:28:08 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-03-23 00:28:08 +0100 |
commit | e19558af1b6979edf27f7a05a6e47a8b5d113390 (patch) | |
tree | f901801a0684eba2f662670a178c43d96918c4db /Lib/asyncio/sslproto.py | |
parent | 060f9bb6024580272440f57c612ca34d9beaa169 (diff) | |
download | cpython-git-e19558af1b6979edf27f7a05a6e47a8b5d113390.tar.gz |
Add a source parameter to warnings.warn()
Issue #26604:
* Add a new optional source parameter to _warnings.warn() and warnings.warn()
* Modify asyncore, asyncio and _pyio modules to set the source parameter when
logging a ResourceWarning warning
Diffstat (limited to 'Lib/asyncio/sslproto.py')
-rw-r--r-- | Lib/asyncio/sslproto.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index dde980b68f..1cea850475 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -324,7 +324,8 @@ class _SSLProtocolTransport(transports._FlowControlMixin, if compat.PY34: def __del__(self): if not self._closed: - warnings.warn("unclosed transport %r" % self, ResourceWarning) + warnings.warn("unclosed transport %r" % self, ResourceWarning, + source=self) self.close() def pause_reading(self): |