mercurial/posix.py
branchstable
changeset 15499 58f96703a9ab
parent 15488 6eff984d8e76
child 15551 1fa41d1f1351
--- a/mercurial/posix.py	Tue Nov 15 02:16:30 2011 +0100
+++ b/mercurial/posix.py	Wed Nov 16 17:55:32 2011 -0600
@@ -258,7 +258,7 @@
 
     def findexisting(executable):
         'Will return executable if existing file'
-        if os.path.exists(executable):
+        if os.path.isfile(executable) and os.access(executable, os.X_OK):
             return executable
         return None
 
@@ -268,9 +268,7 @@
     for path in os.environ.get('PATH', '').split(os.pathsep):
         executable = findexisting(os.path.join(path, command))
         if executable is not None:
-            st = os.stat(executable)
-            if (st.st_mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)):
-                return executable
+            return executable
     return None
 
 def setsignalhandler():