mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
[3.12] gh-105324: Fix tokenize module main function for stdin (GH-105325) (#105330)
This commit is contained in:
parent
ab660e9a53
commit
3aa3be4fe3
2 changed files with 3 additions and 2 deletions
|
@ -490,8 +490,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
filename = "<stdin>"
|
filename = "<stdin>"
|
||||||
tokens = _generate_tokens_from_c_tokenizer(
|
tokens = _generate_tokens_from_c_tokenizer(
|
||||||
(x.encode('utf-8') for x in iter(sys.stdin.readline, "")
|
sys.stdin.readline, extra_tokens=True)
|
||||||
), "utf-8", extra_tokens=True)
|
|
||||||
|
|
||||||
|
|
||||||
# Output the tokenization
|
# Output the tokenization
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Fix the main function of the :mod:`tokenize` module when reading from
|
||||||
|
``sys.stdin``. Patch by Pablo Galindo
|
Loading…
Add table
Add a link
Reference in a new issue