cpython: ac1995b01028 (original) (raw)

Mercurial > cpython

changeset 97625:ac1995b01028 3.5

Issue #24993: Handle import error in namereplace error handler Handle PyCapsule_Import() failure (exception) in PyCodec_NameReplaceErrors(): return immedialty NULL. [#24993]

Victor Stinner victor.stinner@gmail.com
date Thu, 03 Sep 2015 16:19:40 +0200
parents abf4acc73b5a
children 716e2bc7d41c ef1f5aebe1a6
files Python/codecs.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-)[+] [-] Python/codecs.c 12

line wrap: on

line diff

--- a/Python/codecs.c +++ b/Python/codecs.c @@ -966,7 +966,6 @@ PyObject *PyCodec_BackslashReplaceErrors } static _PyUnicode_Name_CAPI *ucnhash_CAPI = NULL; -static int ucnhash_initialized = 0; PyObject *PyCodec_NameReplaceErrors(PyObject *exc) { @@ -988,17 +987,17 @@ PyObject *PyCodec_NameReplaceErrors(PyOb return NULL; if (!(object = PyUnicodeEncodeError_GetObject(exc))) return NULL;

@@ -1021,8 +1020,7 @@ PyObject *PyCodec_NameReplaceErrors(PyOb i < end; ++i) { c = PyUnicode_READ_CHAR(object, i); *outp++ = '\';