Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03f53a7

Browse files
committed
Use the default shell to capture shell output.
Adhere to the user $SHELL choice when capturing output from system commands. This makes the getoutput() behavior consistent with that of the system() interactive function.
1 parent 33883d8 commit 03f53a7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

IPython/utils/_process_common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import subprocess
1818
import shlex
1919
import sys
20+
import os
2021

2122
from IPython.utils import py3compat
2223

@@ -70,6 +71,7 @@ def process_handler(cmd, callback, stderr=subprocess.PIPE):
7071
# On win32, close_fds can't be true when using pipes for stdin/out/err
7172
close_fds = sys.platform != 'win32'
7273
p = subprocess.Popen(cmd, shell=isinstance(cmd, py3compat.string_types),
74+
executable=os.environ.get('SHELL'),
7375
stdin=subprocess.PIPE,
7476
stdout=subprocess.PIPE,
7577
stderr=stderr,

0 commit comments

Comments
 (0)