summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Wise <pabs3@bonedaddy.net>2013-06-07 13:49:54 +0800
committerPaul Wise <pabs3@bonedaddy.net>2013-06-07 13:49:54 +0800
commite9fb7ae0246f32efdc8dab579c84926754ccdd42 (patch)
treee2ff47d3406ee3e270a5887c87f165796d38b99b
parent65625d1b5cee169247e9479445cfa497c10bc006 (diff)
downloadiotop-e9fb7ae0246f32efdc8dab579c84926754ccdd42.tar.gz
Be specific about which exceptions are being caught.
http://docs.python.org/2/howto/doanddont.html#except
-rw-r--r--iotop/data.py2
-rw-r--r--iotop/ui.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/iotop/data.py b/iotop/data.py
index 8a6188e..c4e961e 100644
--- a/iotop/data.py
+++ b/iotop/data.py
@@ -38,7 +38,7 @@ ioaccounting = os.path.exists('/proc/self/io')
try:
from iotop.vmstat import VmStat
vmstat_f = VmStat()
-except:
+except IOError:
vm_event_counters = False
else:
vm_event_counters = True
diff --git a/iotop/ui.py b/iotop/ui.py
index 5ea22bc..31a9ae4 100644
--- a/iotop/ui.py
+++ b/iotop/ui.py
@@ -645,7 +645,7 @@ def main():
def safe_main_loop():
try:
main_loop()
- except:
+ except Exception:
pass
_profile(safe_main_loop)
else: