I'm trying to upgrade from: SWIG 2.0.11 and Python 2.7.12 to SWIG 3.0.12 and Python 3.6, but I get the following exception when I run the tests on any iterator (automatically generated using %template):
SystemError: <built-in function xxx_iterator> returned a result with an error set
For example, even the simplest iteration fails:
Traceback (most recent call last):
File "testRender.py", line 459, in testRender
for v in vertices:
File "ncore.py", line 90833, in __iter__
return self.iterator()
File "ncore.py", line 90830, in iterator
return _ncore.Vertices_iterator(self)
SystemError: <built-in function Vertices_iterator> returned a result with an error set
Any ideas?
Again, this was all working great with SWIG 2.0.11 and Python 2.7.12....
Edit: Adding simpler example:
It could be ANY %template-generated iterator, so, for example, this template, defined in the .i file:
%template(Ints) std::list<int>;
will fail when using this simple code:
intsList = ncore.Ints()
intsList.append(1)
intsList.append(2)
for i in intsList:
print(i)
with a message similar to this:
Traceback (most recent call last):
File "testRender.py", line 459, in testRender
for i in intsList:
File "ncore.py", line 90833, in __iter__
return self.iterator()
File "ncore.py", line 90830, in iterator
return _ncore.Ints_iterator(self)
SystemError: <built-in function Ints_iterator> returned a result with an error set
Vertices_iterator
it's impossible to give any help. – MSeifert