From f15a29f975bbdef6de0aa19a19b176d1baf8f5ab Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 4 May 2007 00:41:39 +0000 Subject: More coding by random modification. Encoding now return bytes instead of str8. eval(), exec(), compile() now accept unicode or bytes. --- Objects/stringobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Objects/stringobject.c') diff --git a/Objects/stringobject.c b/Objects/stringobject.c index f74c5dc730..2ebaca83a8 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -3181,9 +3181,9 @@ string_encode(PyStringObject *self, PyObject *args) 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); -- cgit v1.2.1