From 17385bd20cc790eb254852162ff1c20fd192de38 Mon Sep 17 00:00:00 2001 From: Andrea Spadaccini <spadaccio@google.com> Date: Mon, 29 Aug 2011 20:28:41 +0100 Subject: [PATCH] Fixes to errors/warnings raised by pylint 0.24 Running pylint 0.24.0 revealed 2 errors and 1 warning. Here is how I fixed them: * jqueue.py: silenced E1101 * netutils.py: rewrote the list comprehension using extend() * watcher/__init__.py: fixed a missing format string parameter These changes are backwards-compatible with pylint 0.21.1. Signed-off-by: Andrea Spadaccini <spadaccio@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- lib/jqueue.py | 2 +- lib/netutils.py | 2 +- lib/watcher/__init__.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/jqueue.py b/lib/jqueue.py index 7138993f3..3cf3b4287 100644 --- a/lib/jqueue.py +++ b/lib/jqueue.py @@ -2187,7 +2187,7 @@ class JobQueue(object): # Try to load from disk job = self.SafeLoadJobFromDisk(job_id, True, writable=False) - assert not job.writable, "Got writable job" + assert not job.writable, "Got writable job" # pylint: disable=E1101 if job: return job.CalcStatus() diff --git a/lib/netutils.py b/lib/netutils.py index 7a1b6d032..80c0219bc 100644 --- a/lib/netutils.py +++ b/lib/netutils.py @@ -583,7 +583,7 @@ class IP6Address(IPAddress): twoparts = address.split("::") sep = len(twoparts[0].split(":")) + len(twoparts[1].split(":")) parts = twoparts[0].split(":") - [parts.append("0") for _ in range(8 - sep)] + parts.extend(["0"] * (8 - sep)) parts += twoparts[1].split(":") else: parts = address.split(":") diff --git a/lib/watcher/__init__.py b/lib/watcher/__init__.py index 64c3f626f..c84f3e802 100644 --- a/lib/watcher/__init__.py +++ b/lib/watcher/__init__.py @@ -106,8 +106,8 @@ def RunWatcherHooks(): try: results = utils.RunParts(hooks_dir) - except Exception: # pylint: disable=W0703 - logging.exception("RunParts %s failed: %s", hooks_dir) + except Exception, err: # pylint: disable=W0703 + logging.exception("RunParts %s failed: %s", hooks_dir, err) return for (relname, status, runresult) in results: -- GitLab