diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-26 04:51:10 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-26 04:51:10 +0000 |
commit | cc4ff11bef05470eee3d584f51fd56335628eaed (patch) | |
tree | 6ea085f22ddce94b717e227b853758edc53a2d92 /Objects/listobject.c | |
parent | 7c22287a9ec43c6fa80bafcc75a58355d7ea8d54 (diff) | |
download | cpython-cc4ff11bef05470eee3d584f51fd56335628eaed.tar.gz |
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 50d9d9b76d..3de07c9bc6 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; |