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