summaryrefslogtreecommitdiff
path: root/checkers/misc.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2014-08-29 12:26:21 -0400
committerBrett Cannon <brett@python.org>2014-08-29 12:26:21 -0400
commit4db529a056fc67153e4053dbc96b7e4e2d9efcc9 (patch)
tree82ed354e2145179066cb0b3ac9ff783a272992af /checkers/misc.py
parentf29cce922245e616467f26ad3abfe84cf1057b15 (diff)
downloadpylint-4db529a056fc67153e4053dbc96b7e4e2d9efcc9.tar.gz
Don't call unicode() directly
Diffstat (limited to 'checkers/misc.py')
-rw-r--r--checkers/misc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/checkers/misc.py b/checkers/misc.py
index 1511e60..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,7 +73,7 @@ class EncodingChecker(BaseChecker):
def _check_encoding(self, lineno, line, file_encoding):
try:
- return unicode(line, file_encoding)
+ 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]))