mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Release codecs variable earlier.
This commit is contained in:
parent
f4063ca8bc
commit
ba8e180f3b
1 changed files with 2 additions and 4 deletions
|
@ -230,16 +230,14 @@ PyObject *codec_getincrementalcodec(const char *encoding,
|
||||||
if (codecs == NULL)
|
if (codecs == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
inccodec = PyObject_GetAttrString(codecs, attrname);
|
inccodec = PyObject_GetAttrString(codecs, attrname);
|
||||||
if (inccodec == NULL) {
|
Py_DECREF(codecs);
|
||||||
Py_DECREF(codecs);
|
if (inccodec == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
if (errors)
|
if (errors)
|
||||||
ret = PyObject_CallFunction(inccodec, "s", errors);
|
ret = PyObject_CallFunction(inccodec, "s", errors);
|
||||||
else
|
else
|
||||||
ret = PyObject_CallFunction(inccodec, NULL);
|
ret = PyObject_CallFunction(inccodec, NULL);
|
||||||
Py_DECREF(inccodec);
|
Py_DECREF(inccodec);
|
||||||
Py_DECREF(codecs);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue