mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #16255: subrocess.Popen uses /system/bin/sh on Android as the shell,
instead of /bin/sh.
This commit is contained in:
parent
f191a9e8e4
commit
b35fc626c1
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue