Skip to content

Commit

Permalink
Fix warning messages from PyDict_GetItem
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickinson committed Jan 3, 2025
1 parent 9f9d007 commit d102536
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions traits/ctraits.c
Original file line number Diff line number Diff line change
Expand Up @@ -3639,7 +3639,7 @@ validate_trait_map(
PyObject *value)
{
PyObject *type_info = trait->py_validate;
if (PyDict_GetItem(PyTuple_GET_ITEM(type_info, 1), value) != NULL) {
if (PyDict_GetItemWithError(PyTuple_GET_ITEM(type_info, 1), value) != NULL) {
Py_INCREF(value);
return value;
}
Expand Down Expand Up @@ -4065,7 +4065,7 @@ validate_trait_complex(
PyErr_Clear();
break;
case 6: /* Mapped item check: */
if (PyDict_GetItem(PyTuple_GET_ITEM(type_info, 1), value)
if (PyDict_GetItemWithError(PyTuple_GET_ITEM(type_info, 1), value)
!= NULL) {
goto done;
}
Expand Down

0 comments on commit d102536

Please sign in to comment.