mirror of
https://github.com/virt-manager/virt-manager.git
synced 2026-08-10 04:58:08 -05:00
pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit, KeyboardInterrupt, and GeneratorExit (which is not an error and should not normally be caught by user code). In situations where you need to catch all “normal” errors, you can catch the base class for all normal exceptions, Exception [2]. [1] https://docs.python.org/2/howto/doanddont.html#except [2] https://docs.python.org/2/library/exceptions.html#Exception
This commit is contained in:
committed by
Cole Robinson
parent
2fd6d9aa32
commit
b93cc3bbc9
+2
-2
@@ -686,7 +686,7 @@ class vmmHost(vmmGObjectUI):
|
||||
for net in self.conn.list_nets():
|
||||
try:
|
||||
net.disconnect_by_func(self.refresh_network)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
net.connect("state-changed", self.refresh_network)
|
||||
model.append([net.get_connkey(), net.get_name(), "network-idle",
|
||||
@@ -936,7 +936,7 @@ class vmmHost(vmmGObjectUI):
|
||||
for iface in self.conn.list_interfaces():
|
||||
try:
|
||||
iface.disconnect_by_func(self.refresh_interface)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
iface.connect("state-changed", self.refresh_interface)
|
||||
model.append([iface.get_connkey(), iface.get_name(),
|
||||
|
||||
Reference in New Issue
Block a user