From d477ce66af709dd5b98ace2e824cc12d711229cd Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 17 Feb 2013 14:45:37 +0100 Subject: [PATCH] Fix assigning to PropertyLinkSub via Python --- src/App/PropertyLinks.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 9ffb1d033..15390fc85 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -254,12 +254,17 @@ void PropertyLinkSub::setPyObject(PyObject *value) setValue(pcObj->getDocumentObjectPtr(),vals); } + else { + std::string error = std::string("type of first element in tuple must be 'DocumentObject', not "); + error += tup[0].ptr()->ob_type->tp_name; + throw Py::TypeError(error); + } } else if(Py_None == value) { setValue(0); } else { - std::string error = std::string("type must be 'DocumentObject', 'NoneType' of ('DocumentObject',['String',]) not "); + std::string error = std::string("type must be 'DocumentObject', 'NoneType' or ('DocumentObject',['String',]) not "); error += value->ob_type->tp_name; throw Py::TypeError(error); }