summaryrefslogtreecommitdiff
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorXavier de Gaye <xdegaye@users.sourceforge.net>2016-12-13 16:32:21 +0100
committerXavier de Gaye <xdegaye@users.sourceforge.net>2016-12-13 16:32:21 +0100
commit658a638b6fe89aef5c8825410cbf3a7b0d08db80 (patch)
tree38199e8a9f3d13a87e57408dfed0f17b0e0a45a7 /Lib/subprocess.py
parentef2479603b167b3fe41fd70fe1d83a9d961fceca (diff)
downloadcpython-658a638b6fe89aef5c8825410cbf3a7b0d08db80.tar.gz
Issue #16255: subrocess.Popen uses /system/bin/sh on Android as the shell,
instead of /bin/sh.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index c40f0179ee..809e59f5eb 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