Thanks to visit codestin.com Credit goes to github.com
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 31a4482 commit 8531755Copy full SHA for 8531755
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