Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add explicit error check
  • Loading branch information
cdce8p committed Jan 7, 2026
commit 8d6ff033ada0a5f3c5772c8a92e9c321286f3611
4 changes: 2 additions & 2 deletions mypyc/lib-rt/dict_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int CPyDict_Update(PyObject *dict, PyObject *stuff) {
int CPyDict_UpdateFromAny(PyObject *dict, PyObject *stuff) {
if (PyDict_CheckExact(dict)) {
// Argh this sucks
if (PyDict_Check(stuff)|| PyObject_HasAttrWithError(stuff, mypyc_interned_str.keys)) {
if (PyDict_Check(stuff) || PyObject_HasAttrWithError(stuff, mypyc_interned_str.keys) > 0) {
return PyDict_Update(dict, stuff);
} else {
return PyDict_MergeFromSeq2(dict, stuff, 1);
Expand All @@ -178,7 +178,7 @@ PyObject *CPyDict_FromAny(PyObject *obj) {
if (!dict) {
return NULL;
}
if (PyObject_HasAttrWithError(obj, mypyc_interned_str.keys)) {
if (PyObject_HasAttrWithError(obj, mypyc_interned_str.keys) > 0) {
res = PyDict_Update(dict, obj);
} else {
res = PyDict_MergeFromSeq2(dict, obj, 1);
Expand Down