diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-01-03 13:16:00 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-01-03 13:16:00 +0100 |
commit | 18bc52cf70c8618e6c67334b6b544dedcb9828dd (patch) | |
tree | 7f4a05aa0776719b0743945aa9ea64d29310831b | |
parent | ce218e7004101dc93e44075fe2f0029529022f25 (diff) | |
download | cpython-18bc52cf70c8618e6c67334b6b544dedcb9828dd.tar.gz |
unicode_char() uses get_latin1_char() to get latin1 singleton characters
-rw-r--r-- | Objects/unicodeobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 1fb5742317..b2279a652d 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1772,6 +1772,9 @@ unicode_char(Py_UCS4 ch) assert(ch <= MAX_UNICODE); + if (ch < 256) + return get_latin1_char(ch); + unicode = PyUnicode_New(1, ch); if (unicode == NULL) return NULL; |