8000 gh-105324: Fix tokenize module main function for stdin by pablogsal · Pull Request #105325 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-105324: Fix tokenize module main function for stdin
  • Loading branch information
pablogsal committed Jun 5, 2023
commit f0294ad384b10bd42f0e91ab008c9f41a4f9d0d5
3 changes: 1 addition & 2 deletions Lib/tokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ def error(message, filename=None, location=None):
else:
filename = "<stdin>"
tokens = _generate_tokens_from_c_tokenizer(
(x.encode('utf-8') for x in iter(sys.stdin.readline, "")
), "utf-8", extra_tokens=True)
sys.stdin.readline, extra_tokens=True)


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