diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-16 20:01:43 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-16 20:01:43 +0900 |
commit | ea1d2d06f897a9685faab231b4ba2bca5fe7fbeb (patch) | |
tree | 74df35e11b24abf1393942e7927da20d171ee8ff /sphinx/pycode/parser.py | |
parent | 2597c4174e386552449991a0a247340de3dbcdcc (diff) | |
parent | 5bf25eb44529cb0546b9b690a142ca7529a062f0 (diff) | |
download | sphinx-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.py | 2 |
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 |