Mercurial > cpython-lru_cache-weakref
diff Python/marshal.c @ 72475:8beaa9a37387
Implement PEP 393.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Wed, 28 Sep 2011 07:41:54 +0200 |
| parents | 5467abaaf5eb |
| children | 5e33219492bc |
line wrap: on
line diff
--- a/Python/marshal.c Tue Sep 27 20:52:04 2011 -0500 +++ b/Python/marshal.c Wed Sep 28 07:41:54 2011 +0200 @@ -311,9 +311,7 @@ } else if (PyUnicode_CheckExact(v)) { PyObject *utf8; - utf8 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(v), - PyUnicode_GET_SIZE(v), - "surrogatepass"); + utf8 = PyUnicode_AsEncodedString(v, "utf8", "surrogatepass"); if (utf8 == NULL) { p->depth--; p->error = WFERR_UNMARSHALLABLE;
