Commit 23e0ef8c authored by Guido Trotter's avatar Guido Trotter
Browse files

Fix a few uncommon pylint errors in compat.py



- 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: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 37e62cb9
......@@ -26,11 +26,13 @@
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
......
......@@ -55,6 +55,7 @@ import IN
from cStringIO import StringIO
try:
# pylint: disable-msg=F0401
import ctypes
except ImportError:
ctypes = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment