mirror of
https://github.com/davidhalter/parso.git
synced 2026-10-25 14:07:22 +08:00
A small improvement to python -m parso.python.tokenize
This commit is contained in:
1 parent
e62a88b190
commit
5fd6469b6f
1 file changed
+3
-2
@@ -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