aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2022-02-25 08:46:33 -0500
committerMatti Picus <matti.picus@gmail.com>2022-02-25 08:46:33 -0500
commita367564c9d5061b63a7de80b4c1a66ed408b65fc (patch)
treed486770354b536ca69b6c34db06df6e34f9c3239
parent#3686: make the last new field of os.statvfs_result non-indexed (diff)
downloadpypy-a367564c9d5061b63a7de80b4c1a66ed408b65fc.tar.gz
pypy-a367564c9d5061b63a7de80b4c1a66ed408b65fc.tar.bz2
pypy-a367564c9d5061b63a7de80b4c1a66ed408b65fc.zip
backport and fix sys._base_executable on windows (issue 3323)
-rwxr-xr-xpypy/interpreter/app_main.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py
index 7b6a4cd3f7..a02e626ec3 100755
--- a/pypy/interpreter/app_main.py
+++ b/pypy/interpreter/app_main.py
@@ -985,8 +985,13 @@ def setup_bootstrap_path(executable):
else:
sys.path[:] = stdlib_path
# from this point on, we are free to use all the unicode stuff we want,
- # This is important for py3k
sys.executable = executable
+ if sys.platform == 'win32':
+ # someday PyPy will grow a PEP 397 launcher. Until then ...
+ exe = executable.replace('\\', '/').rsplit('/', 1)[-1]
+ sys._base_executable = sys.base_prefix + '\\' + exe
+ else:
+ sys._base_executable = executable
@hidden_applevel
def entry_point(executable, bargv, argv):