aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2020-09-23 13:14:25 +0200
committerChristian Tismer <tismer@stackless.com>2020-09-24 11:35:12 +0000
commit03b9069a7e408568e98cc826c0cb7ea2e5035f1c (patch)
tree0e072296b1a7c5a47a0d305b3a2111322b9e3605 /sources/shiboken2/libshiboken
parent9eee97b5e66c9771e428539eb340b2c2a3756968 (diff)
Signature: Revert SbkSpecial_Type_Ready to PyType_Ready
The early signature module tried to minimize the visible changes to the code base. It replaced the `PyType_Ready` call by a special version which did other things as well. We replace that special call by a more intuitive function `InitSignatureStrings` that does exactly that and nothing more. The functionality of the module is unchanged. Change-Id: Ic2f9cd29b0352f0a24daa55b01420c77d103c0b2 Task-number: PYSIDE-510 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/libshiboken')
-rw-r--r--sources/shiboken2/libshiboken/basewrapper.cpp7
-rw-r--r--sources/shiboken2/libshiboken/basewrapper.h1
-rw-r--r--sources/shiboken2/libshiboken/signature.cpp5
-rw-r--r--sources/shiboken2/libshiboken/signature.h2
4 files changed, 3 insertions, 12 deletions
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp
index 6c4dea642..d866d133c 100644
--- a/sources/shiboken2/libshiboken/basewrapper.cpp
+++ b/sources/shiboken2/libshiboken/basewrapper.cpp
@@ -1102,7 +1102,6 @@ introduceWrapperType(PyObject *enclosingObject,
const char *typeName,
const char *originalName,
PyType_Spec *typeSpec,
- const char *signatureStrings[],
ObjectDestructor cppObjDtor,
SbkObjectType *baseType,
PyObject *baseTypes,
@@ -1127,12 +1126,8 @@ introduceWrapperType(PyObject *enclosingObject,
BindingManager::instance().addClassInheritance(baseType, type);
}
}
- // PYSIDE-510: Here is the single change to support signatures.
- if (SbkSpecial_Type_Ready(enclosingObject, reinterpret_cast<PyTypeObject *>(type), signatureStrings) < 0) {
- std::cerr << "Warning: " << __FUNCTION__ << " returns nullptr for "
- << typeName << '/' << originalName << " due to SbkSpecial_Type_Ready() failing\n";
+ if (PyType_Ready(reinterpret_cast<PyTypeObject *>(type)) < 0)
return nullptr;
- }
initPrivateData(type);
auto sotp = PepType_SOTP(type);
diff --git a/sources/shiboken2/libshiboken/basewrapper.h b/sources/shiboken2/libshiboken/basewrapper.h
index 1190f3187..31083522b 100644
--- a/sources/shiboken2/libshiboken/basewrapper.h
+++ b/sources/shiboken2/libshiboken/basewrapper.h
@@ -234,7 +234,6 @@ LIBSHIBOKEN_API SbkObjectType *introduceWrapperType(PyObject *enclosingObject,
const char *typeName,
const char *originalName,
PyType_Spec *typeSpec,
- const char *signatureStrings[],
ObjectDestructor cppObjDtor,
SbkObjectType *baseType,
PyObject *baseTypes,
diff --git a/sources/shiboken2/libshiboken/signature.cpp b/sources/shiboken2/libshiboken/signature.cpp
index 242fe18c1..3498829e7 100644
--- a/sources/shiboken2/libshiboken/signature.cpp
+++ b/sources/shiboken2/libshiboken/signature.cpp
@@ -1182,11 +1182,8 @@ static int _build_func_to_type(PyObject *obtype)
return 0;
}
-int SbkSpecial_Type_Ready(PyObject * /* module */, PyTypeObject *type,
- const char *signatures[])
+int InitSignatureStrings(PyTypeObject *type, const char *signatures[])
{
- if (PyType_Ready(type) < 0)
- return -1;
auto *ob_type = reinterpret_cast<PyObject *>(type);
int ret = PySide_BuildSignatureArgs(ob_type, signatures);
if (ret < 0) {
diff --git a/sources/shiboken2/libshiboken/signature.h b/sources/shiboken2/libshiboken/signature.h
index 2a69df9cf..c5f515a7f 100644
--- a/sources/shiboken2/libshiboken/signature.h
+++ b/sources/shiboken2/libshiboken/signature.h
@@ -45,7 +45,7 @@
extern "C"
{
-LIBSHIBOKEN_API int SbkSpecial_Type_Ready(PyObject *, PyTypeObject *, const char *[]);
+LIBSHIBOKEN_API int InitSignatureStrings(PyTypeObject *, const char *[]);
LIBSHIBOKEN_API void FinishSignatureInitialization(PyObject *, const char *[]);
LIBSHIBOKEN_API void SetError_Argument(PyObject *, const char *);
LIBSHIBOKEN_API PyObject *Sbk_TypeGet___signature__(PyObject *, PyObject *);