diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-26 04:51:10 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-26 04:51:10 (GMT) |
commit | ed2b7397a0558414e1ec61c48bc889bb05e261ea (patch) | |
tree | 2516676def25ff2857db8fffebbe97fb23c1cb54 /Objects/listobject.c | |
parent | 6ea45d33412d4ecb2862645d57137b7ea1223281 (diff) | |
download | cpython-ed2b7397a0558414e1ec61c48bc889bb05e261ea.zip cpython-ed2b7397a0558414e1ec61c48bc889bb05e261ea.tar.gz cpython-ed2b7397a0558414e1ec61c48bc889bb05e261ea.tar.bz2 |
Use unicode and remove support for some uses of str8.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r-- | Objects/listobject.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index 50d9d9b..3de07c9 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1942,6 +1942,7 @@ static int is_default_cmp(PyObject *cmpfunc) { PyCFunctionObject *f; + const char *module; if (cmpfunc == NULL || cmpfunc == Py_None) return 1; if (!PyCFunction_Check(cmpfunc)) @@ -1949,9 +1950,12 @@ is_default_cmp(PyObject *cmpfunc) f = (PyCFunctionObject *)cmpfunc; if (f->m_self != NULL) return 0; - if (!PyString_Check(f->m_module)) + if (!PyUnicode_Check(f->m_module)) return 0; - if (strcmp(PyString_AS_STRING(f->m_module), "__builtin__") != 0) + module = PyUnicode_AsString(f->m_module); + if (module == NULL) + return 0; + if (strcmp(module, "__builtin__") != 0) return 0; if (strcmp(f->m_ml->ml_name, "cmp") != 0) return 0; |