diff options
author | Nikita Slyusarev <nslus@yandex-team.com> | 2022-02-10 16:46:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:52 +0300 |
commit | cd77cecfc03a3eaf87816af28a33067c4f0cdb59 (patch) | |
tree | 1308e0bae862d52e0020d881fe758080437fe389 /contrib/python/ipython/py2/IPython/utils/_process_common.py | |
parent | cdae02d225fb5b3afbb28990e79a7ac6c9125327 (diff) | |
download | ydb-cd77cecfc03a3eaf87816af28a33067c4f0cdb59.tar.gz |
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/ipython/py2/IPython/utils/_process_common.py')
-rw-r--r-- | contrib/python/ipython/py2/IPython/utils/_process_common.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/python/ipython/py2/IPython/utils/_process_common.py b/contrib/python/ipython/py2/IPython/utils/_process_common.py index 9ede30d3f8..e1b305f734 100644 --- a/contrib/python/ipython/py2/IPython/utils/_process_common.py +++ b/contrib/python/ipython/py2/IPython/utils/_process_common.py @@ -17,7 +17,7 @@ of subprocess utilities, and it contains tools that are common to all of them. import subprocess import shlex import sys -import os +import os from IPython.utils import py3compat @@ -70,14 +70,14 @@ def process_handler(cmd, callback, stderr=subprocess.PIPE): sys.stderr.flush() # On win32, close_fds can't be true when using pipes for stdin/out/err close_fds = sys.platform != 'win32' - # Determine if cmd should be run with system shell. - shell = isinstance(cmd, py3compat.string_types) - # On POSIX systems run shell commands with user-preferred shell. - executable = None - if shell and os.name == 'posix' and 'SHELL' in os.environ: - executable = os.environ['SHELL'] - p = subprocess.Popen(cmd, shell=shell, - executable=executable, + # Determine if cmd should be run with system shell. + shell = isinstance(cmd, py3compat.string_types) + # On POSIX systems run shell commands with user-preferred shell. + executable = None + if shell and os.name == 'posix' and 'SHELL' in os.environ: + executable = os.environ['SHELL'] + p = subprocess.Popen(cmd, shell=shell, + executable=executable, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr, |