8000 PyIter.MoveNext: propagate Python exception if any · losttech/pythonnet@fa4cebd · GitHub
[go: up one dir, main page]

Skip to content

Commit fa4cebd

Browse files
committed
PyIter.MoveNext: propagate Python exception if any
1 parent 1c36bc0 commit fa4cebd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/runtime/pyiter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public bool MoveNext()
3737
using var next = Runtime.PyIter_Next(Reference);
3838
if (next.IsNull())
3939
{
40+
if (Exceptions.ErrorOccurred())
41+
throw PythonException.ThrowLastAsClrException();
42+
4043
// dispose of the previous object, if there was one
4144
_current = null;
4245
return false;

0 commit comments

Comments
 (0)
0