From 015bba6949a2b3fa8d2bb3ab043ce62288daf649 Mon Sep 17 00:00:00 2001 From: "Tod D. Romo" Date: Mon, 24 Oct 2022 13:59:00 -0400 Subject: [PATCH] Bug fix: correctly catch loos::StopIteration exceptions for AtomicGroupIterator --- src/AtomicGroup.i | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AtomicGroup.i b/src/AtomicGroup.i index 28abcc407..3bc2b19a9 100644 --- a/src/AtomicGroup.i +++ b/src/AtomicGroup.i @@ -71,7 +71,7 @@ pAtom __next__() { if (_idx >= _ag->size()) - throw(loos::StopIteration()); + throw(StopIteration()); return((*_ag)[_idx++]); } @@ -85,6 +85,7 @@ %} +%catches(loos::StopIteration) loos::AtomicGroupPythonIterator::__next__(); // Translate C++ exception into Python's %typemap(throws) loos::StopIteration %{