Bug 540518 - when searching for debugger, ignore directory names. r=jgriffin
authorJesse Ruderman <jruderman@gmail.com>
Thu, 21 Jan 2010 12:02:51 -0800
changeset 37379 8ca13657839c556097f66de6338cf4681c114fe1
parent 37378 fe8f47a3107bf0463f25c7aa20371ab917b33af4
child 37380 33b23aeba63062c5ba934db8bd60152311783652
push id11269
push userjruderman@mozilla.com
push dateThu, 21 Jan 2010 20:03:02 +0000
treeherdermozilla-central@8ca13657839c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs540518
milestone1.9.3a1pre
Bug 540518 - when searching for debugger, ignore directory names. r=jgriffin
build/automationutils.py
--- a/build/automationutils.py
+++ b/build/automationutils.py
@@ -129,25 +129,25 @@ def checkForCrashes(dumpDir, symbolsPath
 def getFullPath(directory, path):
   "Get an absolute path relative to 'directory'."
   return os.path.normpath(os.path.join(directory, os.path.expanduser(path)))
 
 def searchPath(directory, path):
   "Go one step beyond getFullPath and try the various folders in PATH"
   # Try looking in the current working directory first.
   newpath = getFullPath(directory, path)
-  if os.path.exists(newpath):
+  if os.path.isfile(newpath):
     return newpath
 
   # At this point we have to fail if a directory was given (to prevent cases
   # like './gdb' from matching '/usr/bin/./gdb').
   if not os.path.dirname(path):
     for dir in os.environ['PATH'].split(os.pathsep):
       newpath = os.path.join(dir, path)
-      if os.path.exists(newpath):
+      if os.path.isfile(newpath):
         return newpath
   return None
 
 def getDebuggerInfo(directory, debugger, debuggerArgs, debuggerInteractive = False):
 
   debuggerInfo = None
 
   if debugger: