Ignore:
Timestamp:
Dec 11, 2015, 1:26:45 AM (10 years ago)
Author:
dmik
Message:

python: Use configured SHELL in subprocess module.

Use the shell that was configured when building python whe
supbropcess.Popen(shell=True) is requested instead of the
hardcoded '/bin/sh' value which might be not there.

Closes #141.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/trunk/Lib/popen2.py

    r10 r603  
    1212warnings.warn("The popen2 module is deprecated.  Use the subprocess module.",
    1313              DeprecationWarning, stacklevel=2)
     14
     15import sysconfig
     16SHELL = sysconfig.get_config_var('SHELL') or '/bin/sh'
    1417
    1518__all__ = ["popen2", "popen3", "popen4"]
     
    8285    def _run_child(self, cmd):
    8386        if isinstance(cmd, basestring):
    84             cmd = ['/bin/sh', '-c', cmd]
     87            cmd = [SHELL, '-c', cmd]
    8588        os.closerange(3, MAXFD)
    8689        try:
Note: See TracChangeset for help on using the changeset viewer.