Skip to content

Commit 015bba6

Browse files
committed
Bug fix: correctly catch loos::StopIteration exceptions for AtomicGroupIterator
1 parent 852c866 commit 015bba6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/AtomicGroup.i

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
pAtom __next__() {
7373
if (_idx >= _ag->size())
74-
throw(loos::StopIteration());
74+
throw(StopIteration());
7575
return((*_ag)[_idx++]);
7676
}
7777

@@ -85,6 +85,7 @@
8585

8686
%}
8787

88+
%catches(loos::StopIteration) loos::AtomicGroupPythonIterator::__next__();
8889

8990
// Translate C++ exception into Python's
9091
%typemap(throws) loos::StopIteration %{

0 commit comments

Comments
 (0)