Python STL container method overloading fix

Fix method overloading of methods that take STL containers of different types.
Due to some error handling that was not cleared during typehecking.
This commit is contained in:
William S Fulton 2019-08-06 19:36:14 +01:00
commit 86cb3a9532
9 changed files with 200 additions and 24 deletions

View file

@ -672,19 +672,13 @@ namespace swig
return const_reference(_seq, n);
}
bool check(bool set_err = true) const
bool check() const
{
Py_ssize_t s = size();
for (Py_ssize_t i = 0; i < s; ++i) {
swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i);
if (!swig::check<value_type>(item)) {
if (set_err) {
char msg[1024];
sprintf(msg, "in sequence element %d", (int)i);
SWIG_Error(SWIG_RuntimeError, msg);
}
if (!swig::check<value_type>(item))
return false;
}
}
return true;
}