summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-02-05 08:48:04 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2019-02-05 08:48:04 +0100
commit51e12f81e410a3459b118e9551e77ff61470d4ef (patch)
tree6bc7c74ed29dd5c49918f71ad928ec098f179b40
parent0ab897742cdd9b6c81da3be5018ee0d29e74457c (diff)
downloadpylint-git-51e12f81e410a3459b118e9551e77ff61470d4ef.tar.gz
Fix a couple of warnings
-rw-r--r--pylint/reporters/json.py4
-rw-r--r--pylint/test/test_func.py2
-rw-r--r--pylint/test/test_self.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/pylint/reporters/json.py b/pylint/reporters/json.py
index 6a5020102..100ed5264 100644
--- a/pylint/reporters/json.py
+++ b/pylint/reporters/json.py
@@ -9,7 +9,7 @@
"""JSON reporter"""
from __future__ import absolute_import, print_function
-import cgi
+import html
import json
import sys
@@ -40,7 +40,7 @@ class JSONReporter(BaseReporter):
"path": msg.path,
"symbol": msg.symbol,
# pylint: disable=deprecated-method; deprecated since 3.2.
- "message": cgi.escape(msg.msg or ""),
+ "message": html.escape(msg.msg or ""),
"message-id": msg.msg_id,
}
)
diff --git a/pylint/test/test_func.py b/pylint/test/test_func.py
index 091a6d71d..0d9694545 100644
--- a/pylint/test/test_func.py
+++ b/pylint/test/test_func.py
@@ -90,7 +90,7 @@ class LintTestUsingModule(object):
def _get_expected(self):
if self._has_output() and self.output:
- with open(self.output, "U") as fobj:
+ with open(self.output, "r") as fobj:
return fobj.read().strip() + "\n"
else:
return ""
diff --git a/pylint/test/test_self.py b/pylint/test/test_self.py
index cbc23176b..2c3907e05 100644
--- a/pylint/test/test_self.py
+++ b/pylint/test/test_self.py
@@ -185,7 +185,7 @@ class TestRunTC(object):
master = re.search(r"\[MASTER", output)
out = StringIO(output[master.start() :])
parser = configparser.RawConfigParser()
- parser.readfp(out)
+ parser.read_file(out)
messages = utils._splitstrip(parser.get("MESSAGES CONTROL", "disable"))
assert "suppressed-message" in messages