Python implicitconv assert fix using debug build of the Python interpreter
An error was not being set if an implicit conversion was attempted calling an explicit constructor. Fixes: Fatal Python error: a function returned NULL without setting an error SystemError: <built-in function new_A> returned NULL without setting an error File "Examples/test-suite/python/implicittest.py", line 106 in __init_
This commit is contained in:
parent
0165180735
commit
3af1b74e57
1 changed files with 4 additions and 1 deletions
|
|
@ -290,7 +290,10 @@ SWIGRUNTIMEINLINE int
|
|||
SWIG_Python_CheckImplicit(swig_type_info *ty)
|
||||
{
|
||||
SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
|
||||
return data ? data->implicitconv : 0;
|
||||
int fail = data ? data->implicitconv : 0;
|
||||
if (fail)
|
||||
PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
|
||||
return fail;
|
||||
}
|
||||
|
||||
SWIGRUNTIMEINLINE PyObject *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue