We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ae7665 commit a6a31cfCopy full SHA for a6a31cf
Modules/pyexpat.c
@@ -109,9 +109,11 @@ static struct HandlerInfo handler_info[64];
109
static int
110
set_xml_error_attr_code(PyObject *err, enum XML_Error code)
111
{
112
+ PyObject *py_id_code = PyUnicode_InternFromString("code");
113
PyObject *v = PyLong_FromLong((long)code);
- int ok = v != NULL && PyObject_SetAttr(err, &_Py_ID(code), v) != -1;
114
+ int ok = v != NULL && PyObject_SetAttr(err, py_id_code, v) != -1;
115
Py_XDECREF(v);
116
+ Py_XDECREF(py_id_code);
117
return ok;
118
}
119
0 commit comments