Revert 34153: Py_UNICODE should not be signed.

This commit is contained in:
Martin v. Löwis 2006-04-13 06:06:08 +00:00
parent 1ad9ec276e
commit 80d2e591d5
1 changed files with 3 additions and 8 deletions

View File

@ -137,12 +137,7 @@ int unicode_resize(register PyUnicodeObject *unicode,
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 &&
unicode->str[0] < 256U &&
unicode_latin1[unicode->str[0]] == unicode)) {
PyErr_SetString(PyExc_SystemError,
"can't resize shared unicode objects");