forked from OSchip/llvm-project
[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:
parent
5b09842179
commit
7defa7a74c
|
@ -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))
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue