aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/libpyside/pysideweakref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/libpyside/pysideweakref.cpp')
-rw-r--r--sources/pyside2/libpyside/pysideweakref.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/sources/pyside2/libpyside/pysideweakref.cpp b/sources/pyside2/libpyside/pysideweakref.cpp
index faa3abe82..cd90634bd 100644
--- a/sources/pyside2/libpyside/pysideweakref.cpp
+++ b/sources/pyside2/libpyside/pysideweakref.cpp
@@ -57,7 +57,7 @@ static PyType_Slot PySideCallableObjectType_slots[] = {
{0, 0}
};
static PyType_Spec PySideCallableObjectType_spec = {
- const_cast<char *>("PySide.Callable"),
+ "1:PySide.Callable",
sizeof(PySideCallableObject),
0,
Py_TPFLAGS_DEFAULT,
@@ -68,7 +68,7 @@ static PyType_Spec PySideCallableObjectType_spec = {
static PyTypeObject *PySideCallableObjectTypeF()
{
static PyTypeObject *type =
- (PyTypeObject *)PyType_FromSpec(&PySideCallableObjectType_spec);
+ reinterpret_cast<PyTypeObject *>(SbkType_FromSpec(&PySideCallableObjectType_spec));
return type;
}
@@ -98,11 +98,6 @@ PyObject *create(PyObject *obj, PySideWeakRefFunction func, void *userData)
PySideCallableObject *callable = PyObject_New(PySideCallableObject, type);
if (!callable || PyErr_Occurred())
return 0;
- if (!PepRuntime_38_flag) {
- // PYSIDE-939: Handling references correctly.
- // Workaround for Python issue 35810; no longer necessary in Python 3.8
- Py_INCREF(type);
- }
PyObject *weak = PyWeakref_NewRef(obj, reinterpret_cast<PyObject *>(callable));
if (!weak || PyErr_Occurred())