cpython: b14a1e81c34a (original) (raw)
Mercurial > cpython
changeset 106013:b14a1e81c34a 3.6
Fix subprocess.Popen.__del__() fox Python shutdown Issue #29174, #26741: subprocess.Popen.__del__() now keeps a strong reference to warnings.warn() function. [#29174]
Victor Stinner victor.stinner@gmail.com | |
---|---|
date | Fri, 06 Jan 2017 10:44:44 +0100 |
parents | 7b9d4a7cfc0f |
children | 0d9530e557db 50424a903593 |
files | Lib/subprocess.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-)[+] [-] Lib/subprocess.py 6 |
line wrap: on
line diff
--- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -750,15 +750,15 @@ class Popen(object): # Wait for the process to terminate, to avoid zombies. self.wait()
- def del(self, _maxsize=sys.maxsize, _warn=warnings.warn): if not self._child_created: # We didn't get to successfully create a child process. return if self.returncode is None: # Not reading subprocess exit status creates a zombi process which # is only destroyed at the parent python process exit
warnings.warn("subprocess %s is still running" % self.pid,[](#l1.15)
ResourceWarning, source=self)[](#l1.16)
_warn("subprocess %s is still running" % self.pid,[](#l1.17)
ResourceWarning, source=self)[](#l1.18) # In case the child hasn't been waited on, check if it's done.[](#l1.19) self._internal_poll(_deadstate=_maxsize)[](#l1.20) if self.returncode is None and _active is not None:[](#l1.21)