Skip to content

Commit f04c168

Browse files
authored
gh-105324: Fix tokenize module main function for stdin (#105325)
1 parent 677cf39 commit f04c168

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/tokenize.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,7 @@ def error(message, filename=None, location=None):
490490
else:
491491
filename = "<stdin>"
492492
tokens = _generate_tokens_from_c_tokenizer(
493-
(x.encode('utf-8') for x in iter(sys.stdin.readline, "")
494-
), "utf-8", extra_tokens=True)
493+
sys.stdin.readline, extra_tokens=True)
495494

496495

497496
# Output the tokenization
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix the main function of the :mod:`tokenize` module when reading from
2+
``sys.stdin``. Patch by Pablo Galindo

0 commit comments

Comments
 (0)