mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-04 12:21:57 +03:00
generator: Support exceptions in Python 2 and 3
Use a syntax for exception handling that works in both Python 2 and Python 3
This commit is contained in:
committed by
Daniel P. Berrange
parent
3af0f02351
commit
0634769595
@ -818,7 +818,8 @@ def buildStubs(module, api_xml):
|
||||
(parser, target) = getparser()
|
||||
parser.feed(data)
|
||||
parser.close()
|
||||
except IOError, msg:
|
||||
except IOError:
|
||||
msg = sys.exc_info()[1]
|
||||
print(file, ":", msg)
|
||||
sys.exit(1)
|
||||
|
||||
@ -837,7 +838,8 @@ def buildStubs(module, api_xml):
|
||||
(parser, target) = getparser()
|
||||
parser.feed(data)
|
||||
parser.close()
|
||||
except IOError, msg:
|
||||
except IOError:
|
||||
msg = sys.exc_info()[1]
|
||||
print(file, ":", msg)
|
||||
|
||||
if not quiet:
|
||||
|
Reference in New Issue
Block a user