Mercurial > cpython-lru_cache-weakref
diff Objects/object.c @ 41700:ddc4be2786fd
Simplify PyObject_Unicode(NULL) by using
PyUnicode_FromString().
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Fri, 11 May 2007 17:25:52 +0000 |
| parents | b39abcbbbbba |
| children | b29d71d43c80 |
line wrap: on
line diff
--- a/Objects/object.c Fri May 11 16:50:42 2007 +0000 +++ b/Objects/object.c Fri May 11 17:25:52 2007 +0000 @@ -435,14 +435,9 @@ PyObject *str; static PyObject *unicodestr; - if (v == NULL) { - res = PyString_FromString("<NULL>"); - if (res == NULL) - return NULL; - str = PyUnicode_FromEncodedObject(res, NULL, "strict"); - Py_DECREF(res); - return str; - } else if (PyUnicode_CheckExact(v)) { + if (v == NULL) + return PyUnicode_FromString("<NULL>"); + else if (PyUnicode_CheckExact(v)) { Py_INCREF(v); return v; }
