Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-10-16 10:03:41 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-10-16 11:55:45 +0200
commit9b3399ae6f35b94e2051692dc2ee9d5eea73472a (patch)
tree654b6ec1cdfefe9220e23ee724f784a6afcac753 /sources/pyside6/libpyside
parentad155e67a208d4ac4c20d7033701d6ddb3d2593e (diff)
PySide6-property: Improve error handling
PyArg_ParseTupleAndKeywords() can return Py_None for invalid types in the property decorator, for which getTypeName() returns "void". Set an error in this case. Pick-to: 6.8 Task-number: PYSIDE-2840 Change-Id: I98a497df445d9b543dddaa495d85042e00673e78 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/libpyside')
-rw-r--r--sources/pyside6/libpyside/pysideproperty.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/pyside6/libpyside/pysideproperty.cpp b/sources/pyside6/libpyside/pysideproperty.cpp
index 689979c83..6ba76200a 100644
--- a/sources/pyside6/libpyside/pysideproperty.cpp
+++ b/sources/pyside6/libpyside/pysideproperty.cpp
@@ -228,7 +228,7 @@ static int qpropertyTpInit(PyObject *self, PyObject *args, PyObject *kwds)
Py_XINCREF(pData->pyTypeObject);
pData->typeName = PySide::Signal::getTypeName(type);
- if (pData->typeName.isEmpty())
+ if (type == Py_None || pData->typeName.isEmpty())
PyErr_SetString(PyExc_TypeError, "Invalid property type or type name.");
else if (pData->constant && ((pData->fset && pData->fset != Py_None)
|| (pData->notify && pData->notify != Py_None)))