Kaydet (Commit) b03ccc04 authored tarafından Walter Dörwald's avatar Walter Dörwald

Simplify PyObject_Unicode(NULL) by using

PyUnicode_FromString().
üst 0368b726
......@@ -435,14 +435,9 @@ PyObject_Unicode(PyObject *v)
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment