diff options
author | Christian Tismer <tismer@stackless.com> | 2020-05-04 17:38:04 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2020-05-14 15:26:11 +0200 |
commit | d6b81b6303957803582d0fae95a9b25483d8e7f2 (patch) | |
tree | aab5f9f3438eb59c21ecc18530c0c48e5c10a393 /sources/shiboken2/libshiboken/voidptr.cpp | |
parent | f6519b1d343bc26a53374d3066e90495f1959c78 (diff) |
shiboken: Prepare for introduction of __qualname__
To remove the groundwork from the next checkin, the step
of replacing PyType_FromSpec with SbkType_FromSpec
is extracted.
This change introduces a packageLevel number that is generated
as a name prefix in the class creation but does not use it, yet.
Change-Id: Ic9061231708b546dbd3620d148bca24c27df60a5
Task-number: PYSIDE-1286
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/voidptr.cpp')
-rw-r--r-- | sources/shiboken2/libshiboken/voidptr.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sources/shiboken2/libshiboken/voidptr.cpp b/sources/shiboken2/libshiboken/voidptr.cpp index 46f49b67e..6ac3c131d 100644 --- a/sources/shiboken2/libshiboken/voidptr.cpp +++ b/sources/shiboken2/libshiboken/voidptr.cpp @@ -340,7 +340,7 @@ static PyType_Slot SbkVoidPtrType_slots[] = { {0, nullptr} }; static PyType_Spec SbkVoidPtrType_spec = { - "shiboken2.libshiboken.VoidPtr", + "2:shiboken2.shiboken2.VoidPtr", sizeof(SbkVoidPtrObject), 0, Py_TPFLAGS_DEFAULT, @@ -353,16 +353,15 @@ static PyType_Spec SbkVoidPtrType_spec = { PyTypeObject *SbkVoidPtrTypeF(void) { static PyTypeObject *type = nullptr; - if (!type) - type = reinterpret_cast<PyTypeObject *>(PyType_FromSpec(&SbkVoidPtrType_spec)); - + if (!type) { + type = reinterpret_cast<PyTypeObject *>(SbkType_FromSpec(&SbkVoidPtrType_spec)); #if PY_VERSION_HEX < 0x03000000 - type->tp_as_buffer = &SbkVoidPtrObjectBufferProc; - type->tp_flags |= Py_TPFLAGS_HAVE_NEWBUFFER; + type->tp_as_buffer = &SbkVoidPtrObjectBufferProc; + type->tp_flags |= Py_TPFLAGS_HAVE_NEWBUFFER; #else - PepType_AS_BUFFER(type) = &SbkVoidPtrObjectBufferProc; + PepType_AS_BUFFER(type) = &SbkVoidPtrObjectBufferProc; #endif - + } return type; } |