diff -r 8bb426d386a5 Objects/unicodeobject.c --- a/Objects/unicodeobject.c Wed Oct 12 20:18:33 2016 +0200 +++ b/Objects/unicodeobject.c Thu Oct 13 12:51:06 2016 +0300 @@ -3232,24 +3232,16 @@ PyUnicode_AsDecodedObject(PyObject *unic const char *encoding, const char *errors) { - PyObject *v; - if (!PyUnicode_Check(unicode)) { PyErr_BadArgument(); - goto onError; + return NULL; } if (encoding == NULL) encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ - v = PyCodec_Decode(unicode, encoding, errors); - if (v == NULL) - goto onError; - return unicode_result(v); - - onError: - return NULL; + return PyCodec_Decode(unicode, encoding, errors); } PyObject *