diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-01-06 09:49:32 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-01-06 09:49:32 (GMT) |
commit | 1459ca64fc5731b57f66f0834db9a2465970c182 (patch) | |
tree | 18d60f5ede0824619e1249cd6d2328a42854b0d7 /Lib/subprocess.py | |
parent | 94a1239ef807cb2bf9004079952fb0e54bb3dc61 (diff) | |
parent | 9505b03bb0d3c5828115fec9306cb976c43f04d9 (diff) | |
download | cpython-1459ca64fc5731b57f66f0834db9a2465970c182.zip cpython-1459ca64fc5731b57f66f0834db9a2465970c182.tar.gz cpython-1459ca64fc5731b57f66f0834db9a2465970c182.tar.bz2 |
Merge 3.6
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 809e59f..c4f84d8 100644 --- 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): + 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, - ResourceWarning, source=self) + _warn("subprocess %s is still running" % self.pid, + ResourceWarning, source=self) # In case the child hasn't been waited on, check if it's done. self._internal_poll(_deadstate=_maxsize) if self.returncode is None and _active is not None: |