mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
unicode_char() uses get_latin1_char() to get latin1 singleton characters
This commit is contained in:
parent
985a82a6d2
commit
f3b46b4a66
1 changed files with 3 additions and 0 deletions
|
@ -1772,6 +1772,9 @@ unicode_char(Py_UCS4 ch)
|
||||||
|
|
||||||
assert(ch <= MAX_UNICODE);
|
assert(ch <= MAX_UNICODE);
|
||||||
|
|
||||||
|
if (ch < 256)
|
||||||
|
return get_latin1_char(ch);
|
||||||
|
|
||||||
unicode = PyUnicode_New(1, ch);
|
unicode = PyUnicode_New(1, ch);
|
||||||
if (unicode == NULL)
|
if (unicode == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue