summaryrefslogtreecommitdiff
path: root/sphinx/pycode/parser.py
diff options
context:
space:
mode:
authorkpnr <hkm@mail.ru>2019-12-09 15:36:45 +0300
committerhkm <hkm@mail.ru>2019-12-12 23:38:01 +0300
commit4148207756df2792a80aead73b68c326391f7dfb (patch)
tree9f834123ab52ebc341071ad985b06dcaee6ace61 /sphinx/pycode/parser.py
parent1044ac4ac141ee063d76fafede3b78a8b386fe9f (diff)
downloadsphinx-git-4148207756df2792a80aead73b68c326391f7dfb.tar.gz
Update parser.py
encoding damages non-ASCII characters
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 0dc07751e..85ae7be3d 100644
--- a/sphinx/pycode/parser.py
+++ b/sphinx/pycode/parser.py
@@ -479,7 +479,7 @@ class Parser:
def parse_comments(self) -> None:
"""Parse the code and pick up comments."""
- tree = ast.parse(self.code.encode())
+ tree = ast.parse(self.code)
picker = VariableCommentPicker(self.code.splitlines(True), self.encoding)
picker.visit(tree)
self.comments = picker.comments