lit/Util.py: On Cygwin, 'PATHEXT' may exist but it should not be used.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 10 Feb 2011 09:11:48 +0000 (09:11 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 10 Feb 2011 09:11:48 +0000 (09:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125272 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/Util.py

index ad4adf2f347399bbe953f6938cf93f9f20f8816b..5635f50baef337f25f67bc44cbae505b1d40c608 100644 (file)
@@ -64,7 +64,11 @@ def which(command, paths = None):
         paths = os.defpath
 
     # Get suffixes to search.
-    pathext = os.environ.get('PATHEXT', '').split(os.pathsep)
+    # On Cygwin, 'PATHEXT' may exist but it should not be used.
+    if os.pathsep == ';':
+        pathext = os.environ.get('PATHEXT', '').split(';')
+    else:
+        pathext = ['']
 
     # Search the paths...
     for path in paths.split(os.pathsep):