[pypy-svn] r48307 - pypy/dist/pypy/translator/goal

tismer at codespeak.net tismer at codespeak.net
Mon Nov 5 10:56:50 CET 2007


Author: tismer
Date: Mon Nov  5 10:56:49 2007
New Revision: 48307

Modified:
   pypy/dist/pypy/translator/goal/app_main.py
Log:
handle .exe correctly, regardless if we search the path or not

Modified: pypy/dist/pypy/translator/goal/app_main.py
==============================================================================
--- pypy/dist/pypy/translator/goal/app_main.py	(original)
+++ pypy/dist/pypy/translator/goal/app_main.py	Mon Nov  5 10:56:49 2007
@@ -252,6 +252,8 @@
     # find the full path to the executable, assuming that if there is no '/'
     # in the provided one then we must look along the $PATH
     os.setup() # this is the faked one
+    if we_are_translated() and IS_WINDOWS and not executable.lower().endswith('.exe'):
+        executable += '.exe'
     if os.sep in executable or (IS_WINDOWS and DRIVE_LETTER_SEP in executable):
         pass    # the path is already more than just an executable name
     else:
@@ -259,8 +261,6 @@
         if path:
             for dir in path.split(os.pathsep):
                 fn = os.path.join(dir, executable)
-                if we_are_translated() and IS_WINDOWS and not fn.lower().endswith('.exe'):
-                    fn += '.exe'
                 if os.path.isfile(fn):
                     executable = fn
                     break



More information about the Pypy-commit mailing list