[Python-checkins] cpython (merge 3.6 -> default): Issue #20572: Remove the subprocess.Popen.wait endtime parameter.

gregory.p.smith python-checkins at python.org
Sun Nov 20 19:31:18 EST 2016


https://hg.python.org/cpython/rev/f02422c6110a
changeset:   105251:f02422c6110a
parent:      105246:044e48c396b5
parent:      105250:0e8aa537c565
user:        Gregory P. Smith <greg at krypto.org>
date:        Sun Nov 20 16:31:07 2016 -0800
summary:
  Issue #20572: Remove the subprocess.Popen.wait endtime parameter.
It was deprecated in 3.4 and undocumented prior to that.

files:
  Lib/subprocess.py           |  17 ++++-------------
  Lib/test/test_subprocess.py |  14 --------------
  Misc/NEWS                   |   3 +++
  3 files changed, 7 insertions(+), 27 deletions(-)


diff --git a/Lib/subprocess.py b/Lib/subprocess.py
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1027,11 +1027,9 @@
             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:
@@ -1386,21 +1384,14 @@
             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
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -2777,19 +2777,5 @@
         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()
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -131,6 +131,9 @@
 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.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list