summaryrefslogtreecommitdiff
path: root/Lib/asyncio/base_subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-23 00:28:08 +0100
committerVictor Stinner <victor.stinner@gmail.com>2016-03-23 00:28:08 +0100
commite19558af1b6979edf27f7a05a6e47a8b5d113390 (patch)
treef901801a0684eba2f662670a178c43d96918c4db /Lib/asyncio/base_subprocess.py
parent060f9bb6024580272440f57c612ca34d9beaa169 (diff)
downloadcpython-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/base_subprocess.py')
-rw-r--r--Lib/asyncio/base_subprocess.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py
index 73425d9bbc..efe08313e7 100644
--- a/Lib/asyncio/base_subprocess.py
+++ b/Lib/asyncio/base_subprocess.py
@@ -122,7 +122,8 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
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 get_pid(self):