diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 0c5c485ebc2..541ded8bacd 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -8397,7 +8397,7 @@ PyUnicode_EncodeCharmap(const Py_UNICODE *p, return NULL; result = _PyUnicode_EncodeCharmap(unicode, mapping, errors); Py_DECREF(unicode); - return NULL; + return result; } PyObject *