]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Py_BuildValue("C") supports non-BMP characters on narrow build
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 14 Jul 2011 23:13:24 +0000 (01:13 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 14 Jul 2011 23:13:24 +0000 (01:13 +0200)
Py_BuildValue("C") doesn't have to check the code point,
PyUnicode_FromOrdinal() checks its input and now supports non-BMP characters
(range U+10000-U+10FFFF).

Python/modsupport.c

index 85b0d6635882ff48a42e9cf6352897c9a724f63b..08f50658832f5b67dc3fa6379e50acaf001954af 100644 (file)
@@ -292,11 +292,6 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
         case 'C':
         {
             int i = va_arg(*p_va, int);
-            if (i < 0 || i > PyUnicode_GetMax()) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "%c arg not in range(0x110000)");
-                return NULL;
-            }
             return PyUnicode_FromOrdinal(i);
         }