diff -r d0ed9643cd57 Lib/subprocess.py --- a/Lib/subprocess.py Thu Nov 17 23:31:29 2016 -0600 +++ b/Lib/subprocess.py Sat Nov 19 22:19:53 2016 -0800 @@ -1031,6 +1031,10 @@ """Wait for child process to terminate. Returns returncode attribute.""" if endtime is not None: + warnings.warn( + "'endtime' argument is deprecated. Use 'timeout' instead", + DeprecationWarning, + stacklevel=2) timeout = self._remaining_time(endtime) if timeout is None: timeout_millis = _winapi.INFINITE @@ -1392,9 +1396,13 @@ 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 not None: + warnings.warn( + "'endtime' argument is deprecated. " + "Use 'timeout' instead", + DeprecationWarning, + stacklevel=2) if endtime is None: endtime = _time() + timeout elif timeout is None: diff -r d0ed9643cd57 Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py Thu Nov 17 23:31:29 2016 -0600 +++ b/Lib/test/test_subprocess.py Sat Nov 19 22:19:53 2016 -0800 @@ -1015,6 +1015,13 @@ # time to start. self.assertEqual(p.wait(timeout=3), 0) + def test_wait_endtime(self): + p = subprocess.Popen([sys.executable, "-c", "pass"]) + with self.assertRaises(subprocess.TimeoutExpired), \ + self.assertWarns(DeprecationWarning): + result = p.wait(endtime=0.0001) + self.assertEqual(result, 0) + def test_invalid_bufsize(self): # an invalid type of the bufsize argument should raise # TypeError.