Update parser.py

encoding damages non-ASCII characters
This commit is contained in:
kpnr 2019-12-09 15:36:45 +03:00 committed by hkm
parent 1044ac4ac1
commit 4148207756

View File

@ -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