Issue #20572: Remove the subprocess.Popen.wait endtime parameter.

It was deprecated in 3.4 and undocumented prior to that.
This commit is contained in:
Gregory P. Smith 2016-11-20 16:31:07 -08:00
commit 82604e03dc
3 changed files with 7 additions and 27 deletions

View File

@ -1027,11 +1027,9 @@ class Popen(object):
return self.returncode return self.returncode
def wait(self, timeout=None, endtime=None): def wait(self, timeout=None):
"""Wait for child process to terminate. Returns returncode """Wait for child process to terminate. Returns returncode
attribute.""" attribute."""
if endtime is not None:
timeout = self._remaining_time(endtime)
if timeout is None: if timeout is None:
timeout_millis = _winapi.INFINITE timeout_millis = _winapi.INFINITE
else: else:
@ -1386,21 +1384,14 @@ class Popen(object):
return (pid, sts) return (pid, sts)
def wait(self, timeout=None, endtime=None): def wait(self, timeout=None):
"""Wait for child process to terminate. Returns returncode """Wait for child process to terminate. Returns returncode
attribute.""" attribute."""
if self.returncode is not None: if self.returncode is not None:
return self.returncode return self.returncode
# endtime is preferred to timeout. timeout is only used for if timeout is not None:
# printing. endtime = _time() + timeout
if endtime is not None or timeout is not None:
if endtime is None:
endtime = _time() + timeout
elif timeout is None:
timeout = self._remaining_time(endtime)
if endtime is not None:
# Enter a busy loop if we have a timeout. This busy loop was # Enter a busy loop if we have a timeout. This busy loop was
# cribbed from Lib/threading.py in Thread.wait() at r71065. # cribbed from Lib/threading.py in Thread.wait() at r71065.
delay = 0.0005 # 500 us -> initial delay of 1 ms delay = 0.0005 # 500 us -> initial delay of 1 ms

View File

@ -2777,19 +2777,5 @@ class ContextManagerTests(BaseTestCase):
self.assertTrue(proc.stdin.closed) self.assertTrue(proc.stdin.closed)
def test_main():
unit_tests = (ProcessTestCase,
POSIXProcessTestCase,
Win32ProcessTestCase,
MiscTests,
ProcessTestCaseNoPoll,
CommandsWithSpaces,
ContextManagerTests,
RunFuncTestCase,
)
support.run_unittest(*unit_tests)
support.reap_children()
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()

View File

@ -131,6 +131,9 @@ Core and Builtins
Library Library
------- -------
- Issue #20572: Remove the subprocess.Popen.wait endtime parameter. It was
deprecated in 3.4 and undocumented prior to that.
- Issue #25659: In ctypes, prevent a crash calling the from_buffer() and - Issue #25659: In ctypes, prevent a crash calling the from_buffer() and
from_buffer_copy() methods on abstract classes like Array. from_buffer_copy() methods on abstract classes like Array.