summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorXavier de Gaye <xdegaye@users.sourceforge.net>2016-12-13 15:32:21 (GMT)
committerXavier de Gaye <xdegaye@users.sourceforge.net>2016-12-13 15:32:21 (GMT)
commitb35fc626c1efe72cf5a0b3c8faf860830aab0a83 (patch)
tree1d3f5b0882d505342f85796474a66cab53f4d6d8 /Lib
parentf191a9e8e4f3fbcf018fac4996d764c2b9d60800 (diff)
downloadcpython-b35fc626c1efe72cf5a0b3c8faf860830aab0a83.zip
cpython-b35fc626c1efe72cf5a0b3c8faf860830aab0a83.tar.gz
cpython-b35fc626c1efe72cf5a0b3c8faf860830aab0a83.tar.bz2
Issue #16255: subrocess.Popen uses /system/bin/sh on Android as the shell,
instead of /bin/sh.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/subprocess.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index c40f017..809e59f 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1204,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