[master 4/8] Take care of exception-related pylint messages.

clumens installerbot-noreply at redhat.com
Thu Jul 16 19:58:04 UTC 2015


From: Chris Lumens <clumens at redhat.com>

---
 meh/dump.py    | 2 ++
 meh/handler.py | 5 +++--
 meh/network.py | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/meh/dump.py b/meh/dump.py
index c45741d..4c9af70 100644
--- a/meh/dump.py
+++ b/meh/dump.py
@@ -21,6 +21,8 @@
 #            Erik Troan <ewt at redhat.com>
 #            Chris Lumens <clumens at redhat.com>
 #
+# pylint: disable=bare-except,broad-except
+
 import copy
 import inspect
 import os
diff --git a/meh/handler.py b/meh/handler.py
index e143006..939731c 100644
--- a/meh/handler.py
+++ b/meh/handler.py
@@ -29,6 +29,7 @@
 
 class NoNetwork(Exception):
     def __init__(self, msg=""):
+        Exception.__init__(self)
         self.msg = msg
 
     def __str__(self):
@@ -267,7 +268,7 @@ def runSave(self, exc_info):
                 ret = callback()
                 if ret:
                     params[item_name] = ret
-            except Exception as exc:
+            except Exception as exc:    # pylint: disable=broad-except
                 params[item_name] = "Caused error: %s" % exc
 
         for fpath in self.conf.fileList:
@@ -280,7 +281,7 @@ def runSave(self, exc_info):
                         params[filename] = fobj.read()
                     else:
                         params[filename+"_file"] = fobj.read()
-            except:
+            except:    # pylint: disable=bare-except
                 #skip files we cannot read
                 continue
 
diff --git a/meh/network.py b/meh/network.py
index e6aa331..ede2b8a 100644
--- a/meh/network.py
+++ b/meh/network.py
@@ -41,5 +41,5 @@ def hasActiveNetDev():
             return True
         else:
             return False
-    except:
+    except dbus.DBusException:
         return False


-- 
To view this commit on github, visit https://github.com/rhinstaller/python-meh/commit/b9cce639e4f132055f3cc498a849fbfd95a40b10


More information about the anaconda-patches mailing list