Test propagation of exceptions after two iterations
| 2178 | 3 // 0 |
| 2179 | |
| 2180 | class E2: |
| 2181 | 'Test propagation of exceptions after two iterations' |
| 2182 | def __init__(self, seqn): |
| 2183 | self.seqn = seqn |
| 2184 | self.i = 0 |
| 2185 | def __iter__(self): |
| 2186 | return self |
| 2187 | def __next__(self): |
| 2188 | if self.i == 2: |
| 2189 | raise ZeroDivisionError |
| 2190 | v = self.seqn[self.i] |
| 2191 | self.i += 1 |
| 2192 | return v |
| 2193 | |
| 2194 | class S: |
| 2195 | 'Test immediate stop' |