diff Objects/stringobject.c @ 41595:2c54763c4504

More coding by random modification. Encoding now return bytes instead of str8. eval(), exec(), compile() now accept unicode or bytes.
author Guido van Rossum <guido@python.org>
date Fri, 04 May 2007 00:41:39 +0000
parents a85d715009ec
children b085eb66b7f6
line wrap: on
line diff
--- a/Objects/stringobject.c	Thu May 03 21:11:35 2007 +0000
+++ b/Objects/stringobject.c	Fri May 04 00:41:39 2007 +0000
@@ -3181,9 +3181,9 @@
     v = PyString_AsEncodedObject((PyObject *)self, encoding, errors);
     if (v == NULL)
         goto onError;
-    if (!PyString_Check(v) && !PyUnicode_Check(v)) {
+    if (!PyBytes_Check(v)) {
         PyErr_Format(PyExc_TypeError,
-                     "encoder did not return a string/unicode object "
+                     "[str8] encoder did not return a bytes object "
                      "(type=%.400s)",
                      v->ob_type->tp_name);
         Py_DECREF(v);