[lit] Remove uses of deprecated except syntax.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 7 Aug 2013 03:16:19 +0000 (03:16 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 7 Aug 2013 03:16:19 +0000 (03:16 +0000)
 - Since we only have a few of these, use the cumbersome method of getting the
   exception object from 'sys' to retain the current pre-2.6 compatibility.

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

utils/lit/lit/TestRunner.py
utils/lit/lit/TestingConfig.py
utils/lit/lit/Util.py

index 548f6f532bcb169819e7f8f0d46a50ad0ea136cb..85e32933172e814b6013009004ba3ac2da0ef499 100644 (file)
@@ -257,7 +257,8 @@ def executeScriptInternal(test, litConfig, tmpBase, commands, cwd):
     results = []
     try:
         exitCode = executeShCmd(cmd, test.config, cwd, results)
-    except InternalShellError,e:
+    except InternalShellError:
+        e = sys.exc_info()[1]
         exitCode = 127
         results.append((e.command, '', e.message, exitCode))
 
index 16e698b6eb0cde3cd222c085f13e91d89bec5867..25168d751b63dd08b0212caef4b0c8243cbcd76b 100644 (file)
@@ -62,10 +62,11 @@ class TestingConfig:
                 exec f in cfg_globals
                 if litConfig.debug:
                     litConfig.note('... loaded config %r' % path)
-            except SystemExit,status:
+            except SystemExit:
+                e = sys.exc_info()[1]
                 # We allow normal system exit inside a config file to just
                 # return control without error.
-                if status.args:
+                if e.args:
                     raise
             f.close()
         else:
index f29480900ce76ca519ff720add0e93b93a9bacd9..298fbd5c5fc855e1f2dbd9da1a6a62d7ee230ec9 100644 (file)
@@ -34,7 +34,8 @@ def mkdir_p(path):
 
     try:
         os.mkdir(path)
-    except OSError,e:
+    except OSError:
+        e = sys.exc_info()[1]
         # Ignore EEXIST, which may occur during a race condition.
         if e.errno != errno.EEXIST:
             raise