NoneType was incorrectly passed to PyString_AsString
The implementation relied on the fact that PyString_AsString is returning NULL for invalid inputs (and causing an error condition), which is then fixed by the call to FROM_UTF8. Now, we will simply return an empty string if Py_None is returned by a python fuction, which resemebles the old behaviour of those methods
This commit is contained in:
parent
4a2a76af37
commit
8bf1954625
|
@ -99,6 +99,11 @@ wxString PYTHON_FOOTPRINT_WIZARD::CallRetStrMethod( const char* aMethod, PyObjec
|
|||
|
||||
PyObject* result = CallMethod( aMethod, aArglist );
|
||||
|
||||
if ( result == Py_None ) {
|
||||
Py_DECREF( result );
|
||||
return ret;
|
||||
}
|
||||
|
||||
if( result )
|
||||
{
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
|
@ -214,6 +219,11 @@ wxString PYTHON_FOOTPRINT_WIZARD::GetParameterPageName( int aPage )
|
|||
|
||||
Py_DECREF( arglist );
|
||||
|
||||
if ( result == Py_None ) {
|
||||
Py_DECREF( result );
|
||||
return ret;
|
||||
}
|
||||
|
||||
if( result )
|
||||
{
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
|
|
Loading…
Reference in New Issue