diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-11 00:56:59 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-11 00:56:59 (GMT) |
commit | e58d91c8f009813dce18711d85f941dc87a7ac5f (patch) | |
tree | b81e5f220e7d79022441f9615aff1dc998e70190 /Lib/sysconfig.py | |
parent | 85677617d51f607b41ac64bf4cca8c38b6fd771a (diff) | |
download | cpython-e58d91c8f009813dce18711d85f941dc87a7ac5f.zip cpython-e58d91c8f009813dce18711d85f941dc87a7ac5f.tar.gz cpython-e58d91c8f009813dce18711d85f941dc87a7ac5f.tar.bz2 |
Fix the test_subprocess failure when sys.executable is meaningless: '' or a directory.
It does not fix #7774.
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 69264d2..2b14bfe 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -84,7 +84,8 @@ _PREFIX = os.path.normpath(sys.prefix) _EXEC_PREFIX = os.path.normpath(sys.exec_prefix) _CONFIG_VARS = 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(): _PROJECT_BASE = realpath(os.path.join(_PROJECT_BASE, pardir)) @@ -294,7 +295,7 @@ def _init_non_posix(vars): vars['SO'] = '.pyd' vars['EXE'] = '.exe' 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 |