python except as

This commit is contained in:
Christopher Dunn 2014-11-19 23:10:02 -06:00
parent 5fda247dab
commit 9aa6144b2a
3 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ def fix_source_eol( path, is_dry_run = True, verbose = True, eol = '\n' ):
raise ValueError( 'Path "%s" is not a file' % path )
try:
f = open(path, 'rb')
except IOError, msg:
except IOError as msg:
print >> sys.stderr, "%s: I/O Error: %s" % (file, str(msg))
return False
try:

View File

@ -84,7 +84,7 @@ def svn_check_if_tag_exist( tag_url ):
"""
try:
list_stdout = svn_command( 'list', tag_url )
except SVNError, e:
except SVNError as e:
if e.returncode != 1 or not str(e).find('tag_url'):
raise e
# otherwise ignore error, meaning tag does not exist

View File

@ -34,7 +34,7 @@ def compareOutputs( expected, actual, message ):
def safeReadFile( path ):
try:
return file( path, 'rt' ).read()
except IOError, e:
except IOError as e:
return '<File "%s" is missing: %s>' % (path,e)
def runAllTests( jsontest_executable_path, input_dir = None,