Ammended 'isinpath' and 'getExecutablePath' to check the current directory as well. 5_1_x

Fri, 16 Sep 2011 19:34:07 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 16 Sep 2011 19:34:07 +0200
branch
5_1_x
changeset 1328
deda60e0670a
parent 1322
b2502047e685
child 1331
5dd594d4466f

Ammended 'isinpath' and 'getExecutablePath' to check the current directory as well.

Utilities/__init__.py file | annotate | diff | comparison | revisions
--- a/Utilities/__init__.py	Thu Sep 15 18:39:57 2011 +0200
+++ b/Utilities/__init__.py	Fri Sep 16 19:34:07 2011 +0200
@@ -612,6 +612,9 @@
     if os.path.isabs(file):
         return os.access(file, os.X_OK)
     
+    if os.path.exists(os.path.join(os.curdir, file)):
+        return os.access(os.path.join(os.curdir, file), os.X_OK)
+    
     path = getEnvironmentEntry('PATH')
     
     # environment variable not defined
@@ -640,6 +643,11 @@
         else:
             return ""
         
+    cur_path = os.path.join(os.curdir, file)
+    if os.path.exists(cur_path):
+        if os.access(cur_path, os.X_OK):
+            return cur_path        
+
     path = os.getenv('PATH')
     
     # environment variable not defined

eric ide

mercurial