summaryrefslogtreecommitdiff
path: root/virtinst/network.py
diff options
context:
space:
mode:
authorRadostin Stoyanov <rstoyanov1@gmail.com>2017-07-24 09:26:48 +0100
committerCole Robinson <crobinso@redhat.com>2017-08-02 13:57:43 -0400
commitb93cc3bbc9aeac76ef643833eef71007fe8ad467 (patch)
treebc13ae01c4add13a9bb2f4c51bd4a0cd4161a0c4 /virtinst/network.py
parent2fd6d9aa32dc9c68e05c07427e9330d466c5a92f (diff)
downloadvirt-manager-b93cc3bbc9aeac76ef643833eef71007fe8ad467.tar.gz
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
Diffstat (limited to 'virtinst/network.py')
-rw-r--r--virtinst/network.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/virtinst/network.py b/virtinst/network.py
index dfc1436d..a7971547 100644
--- a/virtinst/network.py
+++ b/virtinst/network.py
@@ -276,7 +276,7 @@ class Network(XMLBuilder):
net.create()
if autostart:
net.setAutostart(autostart)
- except:
+ except Exception:
net.undefine()
raise