| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 31a4482 commit 8531755
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,9 +23,21 @@ public Iterator(IEnumerator e) | |||
| 23 | 23 | public static IntPtr tp_iternext(IntPtr ob) | |
| 24 | 24 | { | |
| 25 | 25 | var self = GetManagedObject(ob) as Iterator; | |
| 26 | - if (!self.iter.MoveNext()) | ||
| 26 | + try | ||
| 27 | 27 | { | |
| 28 | - Exceptions.SetError(Exceptions.StopIteration, Runtime.PyNone); | ||
| 28 | + 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); | ||
| 29 | 41 | return IntPtr.Zero; | |
| 30 | 42 | } | |
| 31 | 43 | object item = self.iter.Current; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments