[Python-checkins] cpython: Py_BuildValue("C") supports non-BMP characters on narrow build

victor.stinner python-checkins at python.org
Fri Jul 15 01:43:51 CEST 2011


http://hg.python.org/cpython/rev/2d6d75eaf98c
changeset:   71339:2d6d75eaf98c
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Fri Jul 15 01:13:24 2011 +0200
summary:
  Py_BuildValue("C") supports non-BMP characters on narrow build

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).

files:
  Python/modsupport.c |  5 -----
  1 files changed, 0 insertions(+), 5 deletions(-)


diff --git a/Python/modsupport.c b/Python/modsupport.c
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -292,11 +292,6 @@
         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);
         }
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list