OILS / mycpp / examples / invalid_try_else.py View on Github | oilshell.org

38 lines, 22 significant
1#!/usr/bin/env python2
2"""
3invalid_try_else.py
4"""
5from __future__ import print_function
6
7
8def f():
9 # type: () -> None
10
11 # Duplicate to see if we can get THREE errors out of mycpp
12
13 try:
14 print('hi')
15 except ValueError:
16 pass
17 else:
18 print('else')
19
20 try:
21 print('hi')
22 except ValueError:
23 pass
24 else:
25 print('else')
26
27
28def run_tests():
29 # type: () -> None
30
31 f()
32
33 try:
34 print('hi')
35 except ValueError:
36 pass
37 else:
38 print('else')