Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3b46b4

Browse files
committed
unicode_char() uses get_latin1_char() to get latin1 singleton characters
1 parent 985a82a commit f3b46b4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Objects/unicodeobject.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,6 +1772,9 @@ unicode_char(Py_UCS4 ch)
17721772

17731773
assert(ch <= MAX_UNICODE);
17741774

1775+
if (ch < 256)
1776+
return get_latin1_char(ch);
1777+
17751778
unicode = PyUnicode_New(1, ch);
17761779
if (unicode == NULL)
17771780
return NULL;

0 commit comments

Comments
 (0)