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. --- Python/marshal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Python/marshal.c') diff --git a/Python/marshal.c b/Python/marshal.c index 94d73a065c..9243798e4b 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -263,14 +263,14 @@ w_object(PyObject *v, WFILE *p) return; } w_byte(TYPE_UNICODE, p); - n = PyString_GET_SIZE(utf8); + n = PyBytes_GET_SIZE(utf8); if (n > INT_MAX) { p->depth--; p->error = 1; return; } w_long((long)n, p); - w_string(PyString_AS_STRING(utf8), (int)n, p); + w_string(PyBytes_AS_STRING(utf8), (int)n, p); Py_DECREF(utf8); } else if (PyTuple_Check(v)) { @@ -1031,7 +1031,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version) if (wf.ptr - base > PY_SSIZE_T_MAX) { Py_DECREF(wf.str); PyErr_SetString(PyExc_OverflowError, - "too much marshall data for a string"); + "too much marshal data for a string"); return NULL; } _PyString_Resize(&wf.str, (Py_ssize_t)(wf.ptr - base)); -- cgit v1.2.1