]> granicus.if.org Git - python/commitdiff
- changed __repr__ to use "unicode escape" encoding for unicode
authorFredrik Lundh <fredrik@pythonware.com>
Sat, 8 Jul 2000 17:43:32 +0000 (17:43 +0000)
committerFredrik Lundh <fredrik@pythonware.com>
Sat, 8 Jul 2000 17:43:32 +0000 (17:43 +0000)
  strings, instead of the default encoding.
  (see "minidom" thread for discussion, and also patch #100706)

Objects/object.c

index a04e00bf79b5cb0b80b00b8b9000bd364859bf3b..9c4cd6a05a37e5813ae53b0d107773ea3052b034 100644 (file)
@@ -267,7 +267,7 @@ PyObject_Repr(v)
                        return NULL;
                if (PyUnicode_Check(res)) {
                        PyObject* str;
-                       str = PyUnicode_AsEncodedString(res, NULL, NULL);
+                       str = PyUnicode_AsUnicodeEscapeString(res);
                        Py_DECREF(res);
                        if (str)
                                res = str;