summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2013-08-07 03:16:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2013-08-07 03:16:19 +0000
commit2e60c882bf989207ad3b33685b2353f62ff3ecd4 (patch)
tree2056e3df69fa97c7a0dcb0ef65e1f686eee80304 /utils
parent26e0af54c2eb3efe468715edada97442e469bb19 (diff)
downloadllvm-2e60c882bf989207ad3b33685b2353f62ff3ecd4.tar.gz
llvm-2e60c882bf989207ad3b33685b2353f62ff3ecd4.tar.bz2
llvm-2e60c882bf989207ad3b33685b2353f62ff3ecd4.tar.xz
[lit] Remove uses of deprecated except syntax.
- 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
Diffstat (limited to 'utils')
-rw-r--r--utils/lit/lit/TestRunner.py3
-rw-r--r--utils/lit/lit/TestingConfig.py5
-rw-r--r--utils/lit/lit/Util.py3
3 files changed, 7 insertions, 4 deletions
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
index 548f6f532b..85e3293317 100644
--- a/utils/lit/lit/TestRunner.py
+++ b/utils/lit/lit/TestRunner.py
@@ -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))
diff --git a/utils/lit/lit/TestingConfig.py b/utils/lit/lit/TestingConfig.py
index 16e698b6eb..25168d751b 100644
--- a/utils/lit/lit/TestingConfig.py
+++ b/utils/lit/lit/TestingConfig.py
@@ -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:
diff --git a/utils/lit/lit/Util.py b/utils/lit/lit/Util.py
index f29480900c..298fbd5c5f 100644
--- a/utils/lit/lit/Util.py
+++ b/utils/lit/lit/Util.py
@@ -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