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/misc.py | |
parent | 001469c8272a235b4f62b9b5c3ee248635168ad4 (diff) | |
parent | c2cc31874880d7f0d5bd444c6a3b17fa817e2509 (diff) | |
download | pylint-python_6.tar.gz |
Merge with defaultpython_6
Diffstat (limited to 'checkers/misc.py')
-rw-r--r-- | checkers/misc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/checkers/misc.py b/checkers/misc.py index b27b86a..d4adfd7 100644 --- a/checkers/misc.py +++ b/checkers/misc.py @@ -21,6 +21,7 @@ import re from pylint.interfaces import IRawChecker from pylint.checkers import BaseChecker +import six MSGS = { @@ -72,8 +73,8 @@ class EncodingChecker(BaseChecker): def _check_encoding(self, lineno, line, file_encoding): try: - return unicode(line, file_encoding) - except UnicodeDecodeError, ex: + return six.text_type(line, file_encoding) + except UnicodeDecodeError as ex: self.add_message('invalid-encoded-data', line=lineno, args=(file_encoding, ex.args[2])) |