Fix a few uncommon pylint errors in compat.py
authorGuido Trotter <ultrotter@google.com>
Tue, 29 Jun 2010 12:07:21 +0000 (13:07 +0100)
committerGuido Trotter <ultrotter@google.com>
Tue, 29 Jun 2010 14:30:28 +0000 (15:30 +0100)
- It's ok if the optional modules functools, roman and hashlib are not there.
- It's ok to reference any and all before defining them. We're doing all
  this exactly because, under python 2.4, they are undefined.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/compat.py
lib/utils.py

index ca656ed..1d75c37 100644 (file)
 import itertools
 
 try:
+  # pylint: disable-msg=F0401
   import functools
 except ImportError:
   functools = None
 
 try:
+  # pylint: disable-msg=F0401
   import roman
 except ImportError:
   roman = None
@@ -42,6 +44,7 @@ except ImportError:
 # modules (hmac, for example) which have changed their behavior as well from
 # one version to the other.
 try:
+  # pylint: disable-msg=F0401
   # Yes, we're not using the imports in this module.
   # pylint: disable-msg=W0611
   from hashlib import md5 as md5_hash
@@ -72,12 +75,16 @@ def _any(seq):
   return False
 
 try:
-  all = all # pylint: disable-msg=W0622
+  # pylint: disable-msg=E0601
+  # pylint: disable-msg=W0622
+  all = all
 except NameError:
   all = _all
 
 try:
-  any = any # pylint: disable-msg=W0622
+  # pylint: disable-msg=E0601
+  # pylint: disable-msg=W0622
+  any = any
 except NameError:
   any = _any
 
index aab8683..1fdc581 100644 (file)
@@ -55,6 +55,7 @@ import IN
 from cStringIO import StringIO
 
 try:
+  # pylint: disable-msg=F0401
   import ctypes
 except ImportError:
   ctypes = None