FiX Correct error handling in pyproxy_set (#1116)

This commit is contained in:
Hood Chatham 2021-01-11 00:09:09 -08:00 committed by GitHub
parent a68833fe6e
commit 0c58294f2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -61,9 +61,9 @@ _pyproxy_set(PyObject* pyobj, JsRef idkey, JsRef idval)
// HC: HACK see comment in _pyproxy_get.
int result;
if (PyDict_Check(pyobj)) {
PyObject_SetItem(pyobj, pykey, pyval);
result = PyObject_SetItem(pyobj, pykey, pyval);
} else {
PyObject_SetAttr(pyobj, pykey, pyval);
result = PyObject_SetAttr(pyobj, pykey, pyval);
}
Py_DECREF(pykey);
Py_DECREF(pyval);