summaryrefslogtreecommitdiffstats
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r--Objects/bytesobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index ab6207b..471d09c 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2713,7 +2713,7 @@ string_decode(PyObject *self, PyObject *args)
return NULL;
if (encoding == NULL)
encoding = PyUnicode_GetDefaultEncoding();
- return PyCodec_Decode(self, encoding, errors);
+ return PyUnicode_FromEncodedObject(self, encoding, errors);
}
@@ -2899,7 +2899,7 @@ string_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
"string argument without an encoding");
return NULL;
}
- new = PyCodec_Encode(x, encoding, errors);
+ new = PyUnicode_AsEncodedString(x, encoding, errors);
if (new == NULL)
return NULL;
assert(PyBytes_Check(new));