[pypy-svn] pypy default: 'sys.executable' should not end up being an non-existing file.

arigo commits-noreply at bitbucket.org
Thu Jan 20 18:52:02 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41062:629b542dc2af
Date: 2011-01-20 18:48 +0100
http://bitbucket.org/pypy/pypy/changeset/629b542dc2af/

Log:	'sys.executable' should not end up being an non-existing file.

diff --git a/pypy/translator/goal/app_main.py b/pypy/translator/goal/app_main.py
--- a/pypy/translator/goal/app_main.py
+++ b/pypy/translator/goal/app_main.py
@@ -227,6 +227,11 @@
                     executable = fn
                     break
     sys.executable = os.path.abspath(executable)
+    #
+    # 'sys.executable' should not end up being an non-existing file;
+    # just use '' in this case. (CPython issue #7774)
+    if not os.path.isfile(sys.executable):
+        sys.executable = ''
 
 def setup_initial_paths(ignore_environment=False, **extra):
     newpath = get_library_path(sys.executable)


More information about the Pypy-commit mailing list