##// END OF EJS Templates
Merge pull request #9511 from pavoljuhas/respect-user-shell...
Thomas Kluyver -
r22415:7a8a2667 merge
parent child Browse files
Show More
@@ -17,6 +17,7 b' of subprocess utilities, and it contains tools that are common to all of them.'
17 import subprocess
17 import subprocess
18 import shlex
18 import shlex
19 import sys
19 import sys
20 import os
20
21
21 from IPython.utils import py3compat
22 from IPython.utils import py3compat
22
23
@@ -69,7 +70,14 b' def process_handler(cmd, callback, stderr=subprocess.PIPE):'
69 sys.stderr.flush()
70 sys.stderr.flush()
70 # On win32, close_fds can't be true when using pipes for stdin/out/err
71 # On win32, close_fds can't be true when using pipes for stdin/out/err
71 close_fds = sys.platform != 'win32'
72 close_fds = sys.platform != 'win32'
72 p = subprocess.Popen(cmd, shell=isinstance(cmd, py3compat.string_types),
73 # Determine if cmd should be run with system shell.
74 shell = isinstance(cmd, py3compat.string_types)
75 # On POSIX systems run shell commands with user-preferred shell.
76 executable = None
77 if shell and os.name == 'posix' and 'SHELL' in os.environ:
78 executable = os.environ['SHELL']
79 p = subprocess.Popen(cmd, shell=shell,
80 executable=executable,
73 stdin=subprocess.PIPE,
81 stdin=subprocess.PIPE,
74 stdout=subprocess.PIPE,
82 stdout=subprocess.PIPE,
75 stderr=stderr,
83 stderr=stderr,
General Comments 0
You need to be logged in to leave comments. Login now