Skip to content

Commit

Permalink
Issue python#20572: Remove the subprocess.Popen.wait endtime parameter.
Browse files Browse the repository at this point in the history
It was deprecated in 3.4 and undocumented prior to that.
  • Loading branch information
gpshead committed Nov 21, 2016
2 parents 439f92a + f0e98c5 commit 82604e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
17 changes: 4 additions & 13 deletions Lib/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,11 +1027,9 @@ def _internal_poll(self, _deadstate=None,
return self.returncode


def wait(self, timeout=None, endtime=None):
def wait(self, timeout=None):
"""Wait for child process to terminate. Returns returncode
attribute."""
if endtime is not None:
timeout = self._remaining_time(endtime)
if timeout is None:
timeout_millis = _winapi.INFINITE
else:
Expand Down Expand Up @@ -1386,21 +1384,14 @@ def _try_wait(self, wait_flags):
return (pid, sts)


def wait(self, timeout=None, endtime=None):
def wait(self, timeout=None):
"""Wait for child process to terminate. Returns returncode
attribute."""
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 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:
if timeout is not None:
endtime = _time() + timeout
# Enter a busy loop if we have a timeout. This busy loop was
# cribbed from Lib/threading.py in Thread.wait() at r71065.
delay = 0.0005 # 500 us -> initial delay of 1 ms
Expand Down
14 changes: 0 additions & 14 deletions Lib/test/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -2777,19 +2777,5 @@ def test_broken_pipe_cleanup(self):
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__":
unittest.main()
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ Core and Builtins
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
from_buffer_copy() methods on abstract classes like Array.

Expand Down

0 comments on commit 82604e0

Please sign in to comment.