Python compatibility fix for r198150
authorAlp Toker <alp@nuanti.com>
Sun, 29 Dec 2013 06:51:10 +0000 (06:51 +0000)
committerAlp Toker <alp@nuanti.com>
Sun, 29 Dec 2013 06:51:10 +0000 (06:51 +0000)
Remove the stat call error reporting for now.

It wasn't essential so silent fallback should be fine here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198155 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/main.py

index 86db3d8f5ac05240d7d4e000f005eb1ebd97a9aa..a2486193e36217cae296cfe49e48f1e3d1d48993 100755 (executable)
@@ -118,16 +118,13 @@ def update_incremental_cache(test):
     fname = test.getFilePath()
     os.utime(fname, None)
 
-def sort_by_incremental_cache(run, litConfig):
+def sort_by_incremental_cache(run):
     def sortIndex(test):
-        index = 0
         fname = test.getFilePath()
         try:
-            index = -os.path.getmtime(fname)
-        except OSError as e:
-            if litConfig.debug:
-                litConfig.note(e)
-        return index
+            return -os.path.getmtime(fname)
+        except:
+            return 0
     run.tests.sort(key = lambda t: sortIndex(t))
 
 def main(builtinParameters = {}):
@@ -319,7 +316,7 @@ def main(builtinParameters = {}):
     if opts.shuffle:
         random.shuffle(run.tests)
     elif opts.incremental:
-        sort_by_incremental_cache(run, litConfig)
+        sort_by_incremental_cache(run)
     else:
         run.tests.sort(key = lambda t: t.getFullName())