Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add assert to check if passed char is str
  • Loading branch information
sergey-miryanov committed Mar 3, 2025
commit ef0d0ee2a98822a1b6bc34158242b8e1dbff0421
1 change: 1 addition & 0 deletions Lib/_pyrepl/base_eventqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def push(self, char: int | bytes | str) -> None:
"""
ord_char = char if isinstance(char, int) else ord(char)
if ord_char > 255:
assert isinstance(char, str)
char = bytes(char.encode(self.encoding))
Comment thread
sergey-miryanov marked this conversation as resolved.
Outdated
self.buf.extend(char)
else:
Expand Down