aboutsummaryrefslogtreecommitdiffstats
path: root/shibokengenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shibokengenerator.cpp')
-rw-r--r--shibokengenerator.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp
index 0b2008f57..570e6ebac 100644
--- a/shibokengenerator.cpp
+++ b/shibokengenerator.cpp
@@ -534,14 +534,25 @@ static QString checkFunctionName(QString baseName, bool genericNumberType, bool
QString ShibokenGenerator::cpythonCheckFunction(const AbstractMetaType* metaType, bool genericNumberType, bool checkExact)
{
+ if (metaType->typeEntry()->isCustom())
+ return guessCPythonCheckFunction(metaType->typeEntry()->name());
return checkFunctionName(cpythonBaseName(metaType), genericNumberType, checkExact);
}
QString ShibokenGenerator::cpythonCheckFunction(const TypeEntry* type, bool genericNumberType, bool checkExact)
{
+ if (type->isCustom())
+ return guessCPythonCheckFunction(type->name());
return checkFunctionName(cpythonBaseName(type), genericNumberType, checkExact);
}
+QString ShibokenGenerator::guessCPythonCheckFunction(const QString& type)
+{
+ if (type == "PyTypeObject")
+ return "PyType_Check";
+ return type+"_Check";
+}
+
QString ShibokenGenerator::cpythonIsConvertibleFunction(const TypeEntry* type)
{
QString baseName;