1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00

[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.

llvm-svn: 187854
This commit is contained in:
Daniel Dunbar 2013-08-07 03:16:19 +00:00
parent 44d0ad7767
commit 34f64801d5
3 changed files with 7 additions and 4 deletions

View 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))

View 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:

View 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