mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
Fix the test_subprocess failure when sys.executable is meaningless: '' or a directory.
It does not fix #7774.
This commit is contained in:
parent
85677617d5
commit
e58d91c8f0
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)
|
||||
_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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue