[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
This commit is contained in:
Daniel Dunbar
2013-08-07 03:16:19 +00:00
parent 26e0af54c2
commit 2e60c882bf
3 changed files with 7 additions and 4 deletions

View File

@@ -257,7 +257,8 @@ def executeScriptInternal(test, litConfig, tmpBase, commands, cwd):
results = [] results = []
try: try:
exitCode = executeShCmd(cmd, test.config, cwd, results) exitCode = executeShCmd(cmd, test.config, cwd, results)
except InternalShellError,e: except InternalShellError:
e = sys.exc_info()[1]
exitCode = 127 exitCode = 127
results.append((e.command, '', e.message, exitCode)) results.append((e.command, '', e.message, exitCode))

View File

@@ -62,10 +62,11 @@ class TestingConfig:
exec f in cfg_globals exec f in cfg_globals
if litConfig.debug: if litConfig.debug:
litConfig.note('... loaded config %r' % path) 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 # We allow normal system exit inside a config file to just
# return control without error. # return control without error.
if status.args: if e.args:
raise raise
f.close() f.close()
else: else:

View File

@@ -34,7 +34,8 @@ def mkdir_p(path):
try: try:
os.mkdir(path) os.mkdir(path)
except OSError,e: except OSError:
e = sys.exc_info()[1]
# Ignore EEXIST, which may occur during a race condition. # Ignore EEXIST, which may occur during a race condition.
if e.errno != errno.EEXIST: if e.errno != errno.EEXIST:
raise raise