We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0f34e9 commit 6b03c63Copy full SHA for 6b03c63
src/runtime/iterator.cs
@@ -23,9 +23,21 @@ public Iterator(IEnumerator e)
23
public static IntPtr tp_iternext(IntPtr ob)
24
{
25
var self = GetManagedObject(ob) as Iterator;
26
- if (!self.iter.MoveNext())
+ try
27
28
- Exceptions.SetError(Exceptions.StopIteration, Runtime.PyNone);
+ if (!self.iter.MoveNext())
29
+ {
30
+ Exceptions.SetError(Exceptions.StopIteration, Runtime.PyNone);
31
+ return IntPtr.Zero;
32
+ }
33
34
+ catch (Exception e)
35
36
+ if (e.InnerException != null)
37
38
+ e = e.InnerException;
39
40
+ Exceptions.SetError(e);
41
return IntPtr.Zero;
42
}
43
object item = self.iter.Current;
0 commit comments