diff options
author | Cole Robinson <crobinso@redhat.com> | 2017-05-05 12:47:21 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2017-05-05 14:52:11 -0400 |
commit | 62feeb02a80f2d5a94773316d9193da9f53ddf3e (patch) | |
tree | 9fb382b8301d7604d82c57d12997b6e482df3947 /virt-xml | |
parent | fcebefd3bba251ba0d5de4381f55789df2c57295 (diff) | |
download | virt-manager-62feeb02a80f2d5a94773316d9193da9f53ddf3e.tar.gz |
Switch to python3 style 'except X as Y' notation
Which also works with python2.7
Diffstat (limited to 'virt-xml')
-rwxr-xr-x | virt-xml | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -94,7 +94,7 @@ def get_domain_and_guest(conn, domstr): domain = conn.lookupByUUIDString(domstr) else: domain = conn.lookupByName(domstr) - except libvirt.libvirtError, e: + except libvirt.libvirtError as e: fail(_("Could not find domain '%s': %s") % (domstr, e)) state = domain.info()[0] @@ -295,7 +295,7 @@ def update_changes(domain, devs, action, confirm): domain.detachDeviceFlags(xml, libvirt.VIR_DOMAIN_AFFECT_LIVE) elif action == "update": domain.updateDeviceFlags(xml, libvirt.VIR_DOMAIN_AFFECT_LIVE) - except libvirt.libvirtError, e: + except libvirt.libvirtError as e: fail(_("Error attempting device %s: %s") % (action, e)) print_stdout(_("Device %s successful.") % action) @@ -476,10 +476,10 @@ def main(conn=None): if __name__ == "__main__": try: sys.exit(main()) - except SystemExit, sys_e: + except SystemExit as sys_e: sys.exit(sys_e.code) except KeyboardInterrupt: logging.debug("", exc_info=True) print_stderr(_("Aborted at user request")) - except Exception, main_e: + except Exception as main_e: fail(main_e) |