diff Objects/unicodeobject.c @ 42625:45183d0b20a7

Get rid of some dead code and unneeded XXX comments by Neal.
author Guido van Rossum <guido@python.org>
date Thu, 16 Aug 2007 21:02:22 +0000
parents 20477cbfd996
children f1a2d51f1cab
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Thu Aug 16 17:55:18 2007 +0000
+++ b/Objects/unicodeobject.c	Thu Aug 16 21:02:22 2007 +0000
@@ -1189,17 +1189,9 @@
         return v;
     if (errors != NULL)
         Py_FatalError("non-NULL encoding in _PyUnicode_AsDefaultEncodedString");
-    /* XXX(nnorwitz): errors will always be NULL due to the check above.
-	Should this check and the else be removed since it's dead code?
-     */
-    if (errors == NULL) {
-        b = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode),
-                                 PyUnicode_GET_SIZE(unicode),
-                                 NULL);
-    }
-    else {
-        b = PyUnicode_AsEncodedString(unicode, NULL, errors);
-    }
+    b = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode),
+                             PyUnicode_GET_SIZE(unicode),
+                             NULL);
     if (!b)
         return NULL;
     v = PyString_FromStringAndSize(PyBytes_AsString(b),