Commit 88044453 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

python: fix return value of emptiness_check_instantiator

* wrap/python/spot.i: Fix typemap for
emptiness_check_instantiator::construct.  The previous code used
to turn (None, "error") into simply ("error").
* wrap/python/ajax/spot.in: Fix handling or errors when
instantiating emptiness checks.
parent 503a57ca
2012-03-04 Alexandre Duret-Lutz <adl@lrde.epita.fr>
python: fix return value of emptiness_check_instantiator
* wrap/python/spot.i: Fix typemap for
emptiness_check_instantiator::construct. The previous code used
to turn (None, "error") into simply ("error").
* wrap/python/ajax/spot.in: Fix handling or errors when
instantiating emptiness checks.
2012-02-25 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* NEWS: Summarize recent changes.
......
......@@ -489,6 +489,7 @@ if output_type == 'r':
if not eci:
unbufprint('<div class="parse-error">Cannot parse "' + opt
+ '" near "' + err + '".</div>')
ec = 0
else:
ec_a = 0
n_acc = degen.number_of_acceptance_conditions()
......
......@@ -110,8 +110,26 @@ using namespace spot;
// function that return errors via a "char **err" argument.
%typemap(in, numinputs=0) char** OUTPUT (char* temp)
"$1 = &temp;";
%typemap(argout, fragment="t_output_helper") char** OUTPUT
"$result = t_output_helper($result, SWIG_FromCharPtr(*$1));";
%typemap(argout) char** OUTPUT {
PyObject *obj = SWIG_FromCharPtr(*$1);
if (!$result) {
$result = obj;
//# If the function returns null_ptr (i.e. Py_None), we
//# don't want to override it with OUTPUT as in the
//# default implementation of t_output_helper.
// } else if ($result == Py_None) {
// Py_DECREF($result);
// $result = obj;
} else {
if (!PyList_Check($result)) {
PyObject *o2 = $result;
$result = PyList_New(1);
PyList_SetItem($result, 0, o2);
}
PyList_Append($result,obj);
Py_DECREF(obj);
}
};
%apply char** OUTPUT { char** err };
// False and True cannot be redefined in Python3, even in a class.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment