Skip to content

Commit

Permalink
Bug fix: correctly catch loos::StopIteration exceptions for AtomicGro…
Browse files Browse the repository at this point in the history
…upIterator
  • Loading branch information
tromo committed Oct 24, 2022
1 parent 852c866 commit 015bba6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/AtomicGroup.i
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

pAtom __next__() {
if (_idx >= _ag->size())
throw(loos::StopIteration());
throw(StopIteration());
return((*_ag)[_idx++]);
}

Expand All @@ -85,6 +85,7 @@

%}

%catches(loos::StopIteration) loos::AtomicGroupPythonIterator::__next__();

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

0 comments on commit 015bba6

Please sign in to comment.