summaryrefslogtreecommitdiff
path: root/sphinx/pycode/parser.py
diff options
context:
space:
mode:
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