From: Raymond Hettinger Date: Fri, 26 Aug 2005 08:39:56 +0000 (+0000) Subject: SF bug #1072182: bad arg type to isspace in struct module X-Git-Tag: v2.5a0~1444 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b3f55f4a706113f24386afd4bb1262b44a1c70c0;p=thirdparty%2FPython%2Fcpython.git SF bug #1072182: bad arg type to isspace in struct module --- diff --git a/Modules/structmodule.c b/Modules/structmodule.c index 33134e920b7e..137b8988e041 100644 --- a/Modules/structmodule.c +++ b/Modules/structmodule.c @@ -959,7 +959,7 @@ calcsize(const char *fmt, const formatdef *f) s = fmt; size = 0; while ((c = *s++) != '\0') { - if (isspace((int)c)) + if (isspace(Py_CHARMASK(c))) continue; if ('0' <= c && c <= '9') { num = c - '0'; @@ -1059,7 +1059,7 @@ struct_pack(PyObject *self, PyObject *args) res = restart = PyString_AsString(result); while ((c = *s++) != '\0') { - if (isspace((int)c)) + if (isspace(Py_CHARMASK(c))) continue; if ('0' <= c && c <= '9') { num = c - '0'; @@ -1191,7 +1191,7 @@ struct_unpack(PyObject *self, PyObject *args) str = start; s = fmt; while ((c = *s++) != '\0') { - if (isspace((int)c)) + if (isspace(Py_CHARMASK(c))) continue; if ('0' <= c && c <= '9') { num = c - '0';