aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-04-18 18:58:18 +0200
committerChristian Tismer <tismer@stackless.com>2021-09-29 17:34:58 +0200
commit096cc9c3703f40f1f596cf79a680dabfaad232bd (patch)
tree328b7d07b98942091eb2ee0464102ed705ee70ad
parentd6cbd662c9158028ee6d370887abffb495a02f5e (diff)
PyPySide: adjust more to PyPy's needs
These are the stable changes which are definitely needed for PyPy to work. Other changes are unclear and stay in the open PyPy patch. Task-number: PYSIDE-535 Change-Id: I660fba3bba9274026cffe0c21498ac57eb5c3b53 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--sources/pyside6/PySide6/glue/qtcore.cpp10
-rw-r--r--sources/pyside6/libpyside/pysidesignal.cpp2
-rw-r--r--sources/shiboken6/libshiboken/pep384impl.cpp4
-rw-r--r--sources/shiboken6/libshiboken/pep384impl.h4
-rw-r--r--sources/shiboken6/libshiboken/signature/signature.cpp2
-rw-r--r--sources/shiboken6/libshiboken/signature/signature_extend.cpp4
6 files changed, 13 insertions, 13 deletions
diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp
index 2b5729a69..bfc405a13 100644
--- a/sources/pyside6/PySide6/glue/qtcore.cpp
+++ b/sources/pyside6/PySide6/glue/qtcore.cpp
@@ -1549,11 +1549,11 @@ QString &res = *%0;
// @snippet return-readData
%RETURN_TYPE %0 = 0;
if (PyBytes_Check(%PYARG_0)) {
- %0 = PyBytes_GET_SIZE(%PYARG_0);
- memcpy(%1, PyBytes_AS_STRING(%PYARG_0), %0);
-} else if (Shiboken::String::check(%PYARG_0)) {
- %0 = Shiboken::String::len(%PYARG_0);
- memcpy(%1, Shiboken::String::toCString(%PYARG_0), %0);
+ %0 = PyBytes_GET_SIZE(%PYARG_0.object());
+ memcpy(%1, PyBytes_AS_STRING(%PYARG_0.object()), %0);
+} else if (Shiboken::String::check(%PYARG_0.object())) {
+ %0 = Shiboken::String::len(%PYARG_0.object());
+ memcpy(%1, Shiboken::String::toCString(%PYARG_0.object()), %0);
}
// @snippet return-readData
diff --git a/sources/pyside6/libpyside/pysidesignal.cpp b/sources/pyside6/libpyside/pysidesignal.cpp
index 842311fae..383f1a64e 100644
--- a/sources/pyside6/libpyside/pysidesignal.cpp
+++ b/sources/pyside6/libpyside/pysidesignal.cpp
@@ -543,7 +543,7 @@ static PyObject *signalInstanceEmit(PyObject *self, PyObject *args)
PySide::PyName::qtEmit()));
Shiboken::AutoDecRef tupleArgs(PyList_AsTuple(pyArgs));
- return PyObject_CallObject(pyMethod, tupleArgs);
+ return PyObject_CallObject(pyMethod.object(), tupleArgs);
}
static PyObject *signalInstanceGetItem(PyObject *self, PyObject *key)
diff --git a/sources/shiboken6/libshiboken/pep384impl.cpp b/sources/shiboken6/libshiboken/pep384impl.cpp
index 6840da924..ce4c3ba9e 100644
--- a/sources/shiboken6/libshiboken/pep384impl.cpp
+++ b/sources/shiboken6/libshiboken/pep384impl.cpp
@@ -323,7 +323,7 @@ _PepUnicode_AsString(PyObject *str)
* Support for longobject.h
*
*/
-#ifdef Py_LIMITED_API
+#if defined(Py_LIMITED_API) || defined(PYPY_VERSION)
/*
* This is the original Python function _PyLong_AsInt() from longobject.c .
@@ -348,7 +348,7 @@ _PepLong_AsInt(PyObject *obj)
}
return int(result);
}
-#endif // Py_LIMITED_API
+#endif // defined(Py_LIMITED_API) || defined(PYPY_VERSION)
/*****************************************************************************
*
diff --git a/sources/shiboken6/libshiboken/pep384impl.h b/sources/shiboken6/libshiboken/pep384impl.h
index ab12daf17..624497f65 100644
--- a/sources/shiboken6/libshiboken/pep384impl.h
+++ b/sources/shiboken6/libshiboken/pep384impl.h
@@ -188,11 +188,11 @@ LIBSHIBOKEN_API const char *PepType_GetNameStr(PyTypeObject *type);
* RESOLVED: longobject.h
*
*/
-#ifdef Py_LIMITED_API
+#if defined(Py_LIMITED_API) || defined(PYPY_VERSION)
LIBSHIBOKEN_API int _PepLong_AsInt(PyObject *);
#else
#define _PepLong_AsInt _PyLong_AsInt
-#endif
+#endif // defined(Py_LIMITED_API) || defined(PYPY_VERSION)
/*****************************************************************************
*
diff --git a/sources/shiboken6/libshiboken/signature/signature.cpp b/sources/shiboken6/libshiboken/signature/signature.cpp
index c844e2694..2894dbace 100644
--- a/sources/shiboken6/libshiboken/signature/signature.cpp
+++ b/sources/shiboken6/libshiboken/signature/signature.cpp
@@ -186,7 +186,7 @@ PyObject *GetSignature_Function(PyObject *obfunc, PyObject *modifier)
int flags = PyCFunction_GET_FLAGS(obfunc);
PyObject *func_kind;
- if (PyModule_Check(obtype_mod))
+ if (PyModule_Check(obtype_mod.object()))
func_kind = PyName::function();
else if (flags & METH_CLASS)
func_kind = PyName::classmethod();
diff --git a/sources/shiboken6/libshiboken/signature/signature_extend.cpp b/sources/shiboken6/libshiboken/signature/signature_extend.cpp
index 528c7c87a..67a37e41c 100644
--- a/sources/shiboken6/libshiboken/signature/signature_extend.cpp
+++ b/sources/shiboken6/libshiboken/signature/signature_extend.cpp
@@ -157,8 +157,8 @@ static PyObject *handle_doc(PyObject *ob, PyObject *old_descr)
init_module_2();
AutoDecRef ob_type_mod(GetClassOrModOf(ob));
const char *name;
- if (PyModule_Check(ob_type_mod))
- name = PyModule_GetName(ob_type_mod);
+ if (PyModule_Check(ob_type_mod.object()))
+ name = PyModule_GetName(ob_type_mod.object());
else
name = reinterpret_cast<PyTypeObject *>(ob_type_mod.object())->tp_name;
if (handle_doc_in_progress || name == nullptr