diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-08-07 03:16:19 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-08-07 03:16:19 +0000 |
commit | 2e60c882bf989207ad3b33685b2353f62ff3ecd4 (patch) | |
tree | 2056e3df69fa97c7a0dcb0ef65e1f686eee80304 | |
parent | 26e0af54c2eb3efe468715edada97442e469bb19 (diff) | |
download | external_llvm-2e60c882bf989207ad3b33685b2353f62ff3ecd4.zip external_llvm-2e60c882bf989207ad3b33685b2353f62ff3ecd4.tar.gz external_llvm-2e60c882bf989207ad3b33685b2353f62ff3ecd4.tar.bz2 |
[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
-rw-r--r-- | utils/lit/lit/TestRunner.py | 3 | ||||
-rw-r--r-- | utils/lit/lit/TestingConfig.py | 5 | ||||
-rw-r--r-- | utils/lit/lit/Util.py | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py index 548f6f5..85e3293 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 16e698b..25168d7 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 f294809..298fbd5 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 |