summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.com>2018-02-14 14:59:47 +0000
committerJames Ennis <james.ennis@codethink.com>2018-03-14 14:10:26 +0000
commitcdd17bf32dc579cf64161c301c6017f6d82e62d8 (patch)
tree2b8a11003887ca297a9117641243a48a1ab8863b
parent1ec691c7603a179ad835db237da89a7d9bd24d25 (diff)
downloadbuildstream-cdd17bf32dc579cf64161c301c6017f6d82e62d8.tar.gz
pylint - dealt with broad-except and bare-except warnings
-rw-r--r--.pylintrc2
-rw-r--r--buildstream/_artifactcache/ostreecache.py4
-rw-r--r--buildstream/_scheduler/job.py2
-rw-r--r--buildstream/_signals.py2
-rwxr-xr-xsetup.py2
5 files changed, 6 insertions, 6 deletions
diff --git a/.pylintrc b/.pylintrc
index feb381e8c..95abb0117 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -112,8 +112,6 @@ disable=#####################################
# Messages that report warnings which should be addressed #
###########################################################
- bare-except,
- broad-except,
consider-merging-isinstance,
dangerous-default-value,
global-statement,
diff --git a/buildstream/_artifactcache/ostreecache.py b/buildstream/_artifactcache/ostreecache.py
index fb1f772a3..30f0105f0 100644
--- a/buildstream/_artifactcache/ostreecache.py
+++ b/buildstream/_artifactcache/ostreecache.py
@@ -427,7 +427,9 @@ class OSTreeCache(ArtifactCache):
remote = self._ensure_remote(self.repo, pull_url)
remote_refs = _ostree.list_remote_refs(self.repo, remote=remote)
q.put((None, push_url, pull_url, remote_refs))
- except Exception as e:
+ except Exception as e: # pylint: disable=broad-except
+ # Whatever happens, we need to return it to the calling process
+ #
q.put((str(e), None, None, None))
# Kick off all the initialization jobs one by one.
diff --git a/buildstream/_scheduler/job.py b/buildstream/_scheduler/job.py
index 7a96452b3..943ccb246 100644
--- a/buildstream/_scheduler/job.py
+++ b/buildstream/_scheduler/job.py
@@ -282,7 +282,7 @@ class Job():
self.child_send_error(e)
self.child_shutdown(1)
- except Exception as e:
+ except Exception as e: # pylint: disable=broad-except
# If an unhandled (not normalized to BstError) occurs, that's a bug,
# send the traceback and formatted exception back to the frontend
diff --git a/buildstream/_signals.py b/buildstream/_signals.py
index ee27190ac..84a5af94f 100644
--- a/buildstream/_signals.py
+++ b/buildstream/_signals.py
@@ -38,7 +38,7 @@ def terminator_handler(signal, frame):
terminator = terminator_stack.pop()
try:
terminator()
- except:
+ except: # pylint: disable=bare-except
# Ensure we print something if there's an exception raised when
# processing the handlers. Note that the default exception
# handler won't be called because we os._exit next, so we must
diff --git a/setup.py b/setup.py
index 134a614c1..8b34f15ef 100755
--- a/setup.py
+++ b/setup.py
@@ -78,7 +78,7 @@ def assert_ostree_version():
try:
gi.require_version('OSTree', '1.0')
from gi.repository import OSTree
- except:
+ except ValueError:
exit_ostree("OSTree not found")
try: