Author: walter.doerwald
Date: Fri May 11 19:25:52 2007
New Revision: 55272

Modified:
   python/branches/py3k-struni/Objects/object.c
Log:
Simplify PyObject_Unicode(NULL) by using
PyUnicode_FromString().


Modified: python/branches/py3k-struni/Objects/object.c
==============================================================================
--- python/branches/py3k-struni/Objects/object.c        (original)
+++ python/branches/py3k-struni/Objects/object.c        Fri May 11 19:25:52 2007
@@ -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;
        }
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to