[llvm] r187854 - [lit] Remove uses of deprecated except syntax.
Daniel Dunbar
daniel at zuster.org
Tue Aug 6 20:16:19 PDT 2013
Author: ddunbar
Date: Tue Aug 6 22:16:19 2013
New Revision: 187854
URL: http://llvm.org/viewvc/llvm-project?rev=187854&view=rev
Log:
[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.
Modified:
llvm/trunk/utils/lit/lit/TestRunner.py
llvm/trunk/utils/lit/lit/TestingConfig.py
llvm/trunk/utils/lit/lit/Util.py
Modified: llvm/trunk/utils/lit/lit/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=187854&r1=187853&r2=187854&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestRunner.py (original)
+++ llvm/trunk/utils/lit/lit/TestRunner.py Tue Aug 6 22:16:19 2013
@@ -257,7 +257,8 @@ def executeScriptInternal(test, litConfi
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))
Modified: llvm/trunk/utils/lit/lit/TestingConfig.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestingConfig.py?rev=187854&r1=187853&r2=187854&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestingConfig.py (original)
+++ llvm/trunk/utils/lit/lit/TestingConfig.py Tue Aug 6 22:16:19 2013
@@ -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:
Modified: llvm/trunk/utils/lit/lit/Util.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/Util.py?rev=187854&r1=187853&r2=187854&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/Util.py (original)
+++ llvm/trunk/utils/lit/lit/Util.py Tue Aug 6 22:16:19 2013
@@ -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
More information about the llvm-commits
mailing list