diff options
author | Gregory P. Smith <greg@krypto.org> | 2016-11-21 00:25:14 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2016-11-21 00:25:14 (GMT) |
commit | f0e98c510dd9bbc77b2ae3ebc888e6fba1549c5d (patch) | |
tree | 9c95d599820021e3f191b3b93ddd0c951c51f7fb /Lib/subprocess.py | |
parent | cf014413159c1fa2e8b1c1201c07b648b8b0adf2 (diff) | |
download | cpython-f0e98c510dd9bbc77b2ae3ebc888e6fba1549c5d.zip cpython-f0e98c510dd9bbc77b2ae3ebc888e6fba1549c5d.tar.gz cpython-f0e98c510dd9bbc77b2ae3ebc888e6fba1549c5d.tar.bz2 |
Issue #20572: The subprocess.Popen.wait method's undocumented endtime
parameter now raises a DeprecationWarning. It was deprecated in 3.4.
It was never documented prior to that.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index e742a4e..0b880f6 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1031,6 +1031,10 @@ class Popen(object): """Wait for child process to terminate. Returns returncode attribute.""" if endtime is not None: + warnings.warn( + "'endtime' argument is deprecated; use 'timeout'.", + DeprecationWarning, + stacklevel=2) timeout = self._remaining_time(endtime) if timeout is None: timeout_millis = _winapi.INFINITE @@ -1392,8 +1396,11 @@ class Popen(object): if self.returncode is not None: return self.returncode - # endtime is preferred to timeout. timeout is only used for - # printing. + if endtime is not None: + warnings.warn( + "'endtime' argument is deprecated; use 'timeout'.", + DeprecationWarning, + stacklevel=2) if endtime is not None or timeout is not None: if endtime is None: endtime = _time() + timeout |