diff options
author | Martin Panter <vadmium+py@gmail.com> | 2017-01-29 10:16:28 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2017-01-29 10:16:28 +0000 |
commit | 23352add84278fc0476b2d6599489fbb70c9f5bc (patch) | |
tree | 600bf5132e46d31b69efbd3bbc8a3d37159c0744 /Lib/subprocess.py | |
parent | 6d1d733828b49eb03d45da81c6b8c6b849fbc5df (diff) | |
parent | 0fb1e3c9fc84c62a91f1e5889dc8e0855cefa4ae (diff) | |
download | cpython-23352add84278fc0476b2d6599489fbb70c9f5bc.tar.gz |
Issues #29349: Merge Py 2 fix 3.6
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 822ddb459e..67b9c9f1b1 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1027,15 +1027,9 @@ class Popen(object): 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: - warnings.warn( - "'endtime' argument is deprecated; use 'timeout'.", - DeprecationWarning, - stacklevel=2) - timeout = self._remaining_time(endtime) if timeout is None: timeout_millis = _winapi.INFINITE else: @@ -1210,7 +1204,10 @@ class Popen(object): args = list(args) if shell: - args = ["/bin/sh", "-c"] + args + # On Android the default shell is at '/system/bin/sh'. + unix_shell = ('/system/bin/sh' if + hasattr(sys, 'getandroidapilevel') else '/bin/sh') + args = [unix_shell, "-c"] + args if executable: args[0] = executable @@ -1393,24 +1390,14 @@ class Popen(object): 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 - 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 - 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 |