diff options
author | Brett Cannon <brett@python.org> | 2014-08-29 15:48:24 -0400 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2014-08-29 15:48:24 -0400 |
commit | 8e23aa2b179274c9c1b128a8b3daf8d2e24cfd75 (patch) | |
tree | c234e08aa390be9bca941e66e508071e5e44a801 /checkers/logging.py | |
parent | 001469c8272a235b4f62b9b5c3ee248635168ad4 (diff) | |
parent | c2cc31874880d7f0d5bd444c6a3b17fa817e2509 (diff) | |
download | pylint-python_6.tar.gz |
Merge with defaultpython_6
Diffstat (limited to 'checkers/logging.py')
-rw-r--r-- | checkers/logging.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/checkers/logging.py b/checkers/logging.py index d82d74b..39c4d9c 100644 --- a/checkers/logging.py +++ b/checkers/logging.py @@ -20,6 +20,9 @@ from pylint import interfaces from pylint.checkers import utils from pylint.checkers.utils import check_messages +import six + + MSGS = { 'W1201': ('Specify string format arguments as logging function parameters', 'logging-not-lazy', @@ -166,7 +169,7 @@ class LoggingChecker(checkers.BaseChecker): # don't check any further. return format_string = node.args[format_arg].value - if not isinstance(format_string, basestring): + if not isinstance(format_string, six.string_types): # If the log format is constant non-string (e.g. logging.debug(5)), # ensure there are no arguments. required_num_args = 0 @@ -178,7 +181,7 @@ class LoggingChecker(checkers.BaseChecker): # Keyword checking on logging strings is complicated by # special keywords - out of scope. return - except utils.UnsupportedFormatCharacter, ex: + except utils.UnsupportedFormatCharacter as ex: char = format_string[ex.index] self.add_message('logging-unsupported-format', node=node, args=(char, ord(char), ex.index)) |