diff options
-rw-r--r-- | sources/shiboken6/generator/shiboken/pytypenames.h | 3 | ||||
-rw-r--r-- | sources/shiboken6/generator/shiboken/shibokengenerator.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sources/shiboken6/generator/shiboken/pytypenames.h b/sources/shiboken6/generator/shiboken/pytypenames.h index 7dd5f8aee..779f67f2f 100644 --- a/sources/shiboken6/generator/shiboken/pytypenames.h +++ b/sources/shiboken6/generator/shiboken/pytypenames.h @@ -44,6 +44,9 @@ static inline QString cPyObjectT() { return QStringLiteral("PyObject"); } static inline QString cPySequenceT() { return QStringLiteral("PySequence"); } static inline QString cPyTypeObjectT() { return QStringLiteral("PyTypeObject"); } +// numpy +static inline QString cPyArrayObjectT() { return QStringLiteral("PyArrayObject"); } + static inline QString sbkCharT() { return QStringLiteral("SbkChar"); } #endif // PYTYPENAMES_H diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp index 75b3fe890..05a9e7571 100644 --- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp +++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp @@ -1121,6 +1121,9 @@ ShibokenGenerator::CPythonCheckFunctionResult if (type == pyStrT()) return {QLatin1String("Shiboken::String::check"), {}}; + if (type == cPyArrayObjectT()) + return {QLatin1String("PyArray_Check"), {}}; + CPythonCheckFunctionResult result; result.type = buildAbstractMetaTypeFromString(type); if (!result.type.has_value() || result.type->typeEntry()->isCustom()) |