mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-09 22:25:53 +08:00
A small improvement to python -m parso.python.tokenize
This commit is contained in:
@@ -406,9 +406,10 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
code = sys.stdin.read()
|
code = sys.stdin.read()
|
||||||
|
|
||||||
|
from parso.utils import source_to_unicode, parse_version_string
|
||||||
|
|
||||||
if isinstance(code, bytes):
|
if isinstance(code, bytes):
|
||||||
from parso.utils import source_to_unicode
|
|
||||||
code = source_to_unicode(code)
|
code = source_to_unicode(code)
|
||||||
|
|
||||||
for token in tokenize(code):
|
for token in tokenize(code, parse_version_string()):
|
||||||
print(token)
|
print(token)
|
||||||
|
|||||||
Reference in New Issue
Block a user