mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-12 10:03:51 +01:00
python except as
This commit is contained in:
parent
5fda247dab
commit
9aa6144b2a
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user