Gui: [skip ci] fix Gui.subgraphFromObject and improve error text if wrapping fails

This commit is contained in:
wmayer
2020-06-19 15:07:57 +02:00
parent 664c641f3c
commit 3ca859acf7
3 changed files with 16 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#include "PyExport.h"
#include "Exception.h"
#include <sstream>
#if (defined(HAVE_SWIG) && (HAVE_SWIG == 1))
#if defined(__clang__)
# pragma clang diagnostic push

View File

@@ -29,8 +29,11 @@ int createSWIGPointerObj_T(const char* TypeName, void* obj, PyObject** ptr, int
swig_type_info * swig_type = 0;
swig_type = SWIG_TypeQuery(TypeName);
if (!swig_type)
throw Base::RuntimeError("Cannot find type information for requested type");
if (!swig_type) {
std::stringstream str;
str << "SWIG: Cannot find type information for requested type: " << TypeName;
throw Base::RuntimeError(str.str());
}
*ptr = SWIG_NewPointerObj(obj,swig_type,own);
if (*ptr == 0)