mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
Update reader.py
This commit is contained in:
parent
a567845b10
commit
7a31a1f32f
1 changed files with 1 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ from .types import Callback, SimpleContextManager, KeySpec, CommandName
|
|||
# syntax classes
|
||||
SYNTAX_WHITESPACE, SYNTAX_WORD, SYNTAX_SYMBOL = range(3)
|
||||
|
||||
def normalize_surrogates(s):
|
||||
def normalize_surrogates(s: str) -> str:
|
||||
# Encode with surrogatepass, decode to normalize surrogate pairs
|
||||
try:
|
||||
return s.encode('utf-16', 'surrogatepass').decode('utf-16')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue