aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken6/libshiboken/basewrapper.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/shiboken6/libshiboken/basewrapper.cpp b/sources/shiboken6/libshiboken/basewrapper.cpp
index ee5c7cc69..611106189 100644
--- a/sources/shiboken6/libshiboken/basewrapper.cpp
+++ b/sources/shiboken6/libshiboken/basewrapper.cpp
@@ -1025,8 +1025,8 @@ introduceWrapperType(PyObject *enclosingObject,
AutoDecRef tpDict(PepType_GetDict(reinterpret_cast<PyTypeObject *>(enclosingObject)));
return PyDict_SetItemString(tpDict, typeName, ob_type) == 0 ? type : nullptr;
}
- assert(PyDict_Check(enclosingObject));
- return PyDict_SetItemString(enclosingObject, typeName, ob_type) == 0 ? type : nullptr;
+ if (PyDict_Check(enclosingObject))
+ return PyDict_SetItemString(enclosingObject, typeName, ob_type) == 0 ? type : nullptr;
}
// PyModule_AddObject steals type's reference.