summaryrefslogtreecommitdiff
path: root/sphinx/pycode/parser.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-16 20:01:43 +0900
committerGitHub <noreply@github.com>2018-12-16 20:01:43 +0900
commitea1d2d06f897a9685faab231b4ba2bca5fe7fbeb (patch)
tree74df35e11b24abf1393942e7927da20d171ee8ff /sphinx/pycode/parser.py
parent2597c4174e386552449991a0a247340de3dbcdcc (diff)
parent5bf25eb44529cb0546b9b690a142ca7529a062f0 (diff)
downloadsphinx-git-ea1d2d06f897a9685faab231b4ba2bca5fe7fbeb.tar.gz
Merge pull request #5803 from jdufresne/encoding-utf8
Avoid respecifying default encoding for .encode()/.decode() calls
Diffstat (limited to 'sphinx/pycode/parser.py')
-rw-r--r--sphinx/pycode/parser.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/pycode/parser.py b/sphinx/pycode/parser.py
index 71630aa3d..09dd8c635 100644
--- a/sphinx/pycode/parser.py
+++ b/sphinx/pycode/parser.py
@@ -480,7 +480,7 @@ class Parser:
def parse_comments(self):
# type: () -> None
"""Parse the code and pick up comments."""
- tree = ast.parse(self.code.encode('utf-8'))
+ tree = ast.parse(self.code.encode())
picker = VariableCommentPicker(self.code.splitlines(True), self.encoding)
picker.visit(tree)
self.comments = picker.comments