mirror of
https://github.com/python/cpython.git
synced 2025-09-19 07:00:59 +00:00
Merged revisions 78830 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78830 | florent.xicluna | 2010-03-11 01:56:59 +0100 (jeu, 11 mar 2010) | 3 lines Fix the test_subprocess failure when sys.executable is meaningless: '' or a directory. It does not fix #7774. ........
This commit is contained in:
parent
a470738b7b
commit
ecf021c7c0
2 changed files with 4 additions and 3 deletions
|
@ -84,7 +84,8 @@ _PREFIX = os.path.normpath(sys.prefix)
|
||||||
_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
|
_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
|
||||||
_CONFIG_VARS = None
|
_CONFIG_VARS = None
|
||||||
_USER_BASE = None
|
_USER_BASE = None
|
||||||
_PROJECT_BASE = os.path.dirname(realpath(sys.executable))
|
# Note: sys.executable can be '' or even a directory, until #7774 is fixed.
|
||||||
|
_PROJECT_BASE = realpath(os.path.dirname(sys.executable))
|
||||||
|
|
||||||
if os.name == "nt" and "pcbuild" in _PROJECT_BASE[-8:].lower():
|
if os.name == "nt" and "pcbuild" in _PROJECT_BASE[-8:].lower():
|
||||||
_PROJECT_BASE = realpath(os.path.join(_PROJECT_BASE, pardir))
|
_PROJECT_BASE = realpath(os.path.join(_PROJECT_BASE, pardir))
|
||||||
|
@ -296,7 +297,7 @@ def _init_non_posix(vars):
|
||||||
vars['SO'] = '.pyd'
|
vars['SO'] = '.pyd'
|
||||||
vars['EXE'] = '.exe'
|
vars['EXE'] = '.exe'
|
||||||
vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
|
vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
|
||||||
vars['BINDIR'] = os.path.dirname(realpath(sys.executable))
|
vars['BINDIR'] = realpath(os.path.dirname(sys.executable))
|
||||||
|
|
||||||
#
|
#
|
||||||
# public APIs
|
# public APIs
|
||||||
|
|
|
@ -135,7 +135,7 @@ class ProcessTestCase(unittest.TestCase):
|
||||||
self.assertEqual(p.stderr, None)
|
self.assertEqual(p.stderr, None)
|
||||||
|
|
||||||
def test_executable_with_cwd(self):
|
def test_executable_with_cwd(self):
|
||||||
python_dir = os.path.dirname(os.path.realpath(sys.executable))
|
python_dir = os.path.realpath(os.path.dirname(sys.executable))
|
||||||
p = subprocess.Popen(["somethingyoudonthave", "-c",
|
p = subprocess.Popen(["somethingyoudonthave", "-c",
|
||||||
"import sys; sys.exit(47)"],
|
"import sys; sys.exit(47)"],
|
||||||
executable=sys.executable, cwd=python_dir)
|
executable=sys.executable, cwd=python_dir)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue