aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/generator/shiboken/cppgenerator.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-09-17 16:45:24 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-10-05 10:39:53 +0200
commit11941d0709110a7bbdcf8911bb368f86a9a5afeb (patch)
treeba5fc221332ce97add3eac5e83d2d013798a97c4 /sources/shiboken6/generator/shiboken/cppgenerator.cpp
parent7a3d79fb13d9f1ef31e7ee3e1e2691abf6d615e4 (diff)
shiboken6: Remove the PyObject_Check helper macro
The macro was there to satisfy the shiboken heuristics which would generate "PyObject_Check" to check for a PyObject, which is always true. Remove the macro and handle "true" in the type entry. [ChangeLog][shiboken6] The macro PyObject_Check() has been removed. Task-number: PYSIDE-1660 Change-Id: I86fc1ed3d8773245deb679142a8ff830cbc19883 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/generator/shiboken/cppgenerator.cpp')
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp3
1 files changed, 2 insertions, 1 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()) {