Skip to content

Commit

Permalink
Rename variable for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Nov 14, 2022
1 parent 2c2c998 commit 41f81a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions simplejson/_speedups.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,13 @@ static int
_call_json_method(PyObject *obj, const char *method_name, PyObject **result)
{
int rval = 0;
PyObject *_asdict = PyObject_GetAttrString(obj, method_name);
if (_asdict == NULL) {
PyObject *method = PyObject_GetAttrString(obj, method_name);
if (method == NULL) {
PyErr_Clear();
return 0;
}
if (PyCallable_Check(_asdict)) {
PyObject *tmp = PyObject_CallNoArgs(_asdict);
if (PyCallable_Check(method)) {
PyObject *tmp = PyObject_CallNoArgs(method);
if (tmp == NULL && PyErr_ExceptionMatches(PyExc_TypeError)) {
PyErr_Clear();
} else {
Expand All @@ -412,7 +412,7 @@ _call_json_method(PyObject *obj, const char *method_name, PyObject **result)
rval = 1;
}
}
Py_DECREF(_asdict);
Py_DECREF(method);
return rval;
}

Expand Down

0 comments on commit 41f81a8

Please sign in to comment.