[Python-checkins] r45336 - python/trunk/Objects/unicodeobject.c

martin.v.loewis python-checkins at python.org
Thu Apr 13 08:06:09 CEST 2006


Author: martin.v.loewis
Date: Thu Apr 13 08:06:08 2006
New Revision: 45336

Modified:
   python/trunk/Objects/unicodeobject.c
Log:
Revert 34153: Py_UNICODE should not be signed.


Modified: python/trunk/Objects/unicodeobject.c
==============================================================================
--- python/trunk/Objects/unicodeobject.c	(original)
+++ python/trunk/Objects/unicodeobject.c	Thu Apr 13 08:06:08 2006
@@ -135,14 +135,9 @@
     /* Resizing shared object (unicode_empty or single character
        objects) in-place is not allowed. Use PyUnicode_Resize()
        instead ! */
-    if (unicode == unicode_empty ||
-	(unicode->length == 1 &&
-         /* MvL said unicode->str[] may be signed.  Python generally assumes
-          * an int contains at least 32 bits, and we don't use more than
-          * 32 bits even in a UCS4 build, so casting to unsigned int should
-          * be correct.
-          */
-	 (unsigned int)unicode->str[0] < 256U &&
+    if (unicode == unicode_empty || 
+	(unicode->length == 1 && 
+	 unicode->str[0] < 256U &&
 	 unicode_latin1[unicode->str[0]] == unicode)) {
         PyErr_SetString(PyExc_SystemError,
                         "can't resize shared unicode objects");


More information about the Python-checkins mailing list