diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-01-03 12:16:00 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-01-03 12:16:00 (GMT) |
commit | f3b46b4a66560945d4c80ac2f10764e3d7f71f8d (patch) | |
tree | 4baaa4ff9edc276655be7289b2c30f7e47a5feab | |
parent | 985a82a6d296a587843e35de643576b957816bdb (diff) | |
download | cpython-f3b46b4a66560945d4c80ac2f10764e3d7f71f8d.zip cpython-f3b46b4a66560945d4c80ac2f10764e3d7f71f8d.tar.gz cpython-f3b46b4a66560945d4c80ac2f10764e3d7f71f8d.tar.bz2 |
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 1fb5742..b2279a6 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; |