aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/generator
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/generator')
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp3
-rw-r--r--sources/shiboken6/generator/shiboken/shibokengenerator.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 284553901..5db3d82e3 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -2399,7 +2399,8 @@ void CppGenerator::writeTypeCheck(TextStream &s, const AbstractMetaType &argType
{
// TODO-CONVERTER: merge this with the code below.
QString typeCheck = cpythonIsConvertibleFunction(argType);
- typeCheck.append(u'(' +argumentName + u')');
+ if (typeCheck != u"true") // For PyObject, which is always true
+ typeCheck.append(u'(' +argumentName + u')');
// TODO-CONVERTER -----------------------------------------------------------------------
if (!argType.typeEntry()->isCustom()) {
diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
index 796c60be7..6bcf2313d 100644
--- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
@@ -1015,7 +1015,7 @@ QString ShibokenGenerator::cpythonCheckFunction(AbstractMetaType metaType) const
if (metaType.isCString())
return QLatin1String("Shiboken::String::check");
if (metaType.isVoidPointer())
- return QLatin1String("PyObject_Check");
+ return u"true"_qs;
return cpythonCheckFunction(typeEntry);
}