fix #675: make 'by' a non-keyword also in .pyx files
[cython.git] / tests / compile / tryexcept.pyx
1 # mode: compile
2
3 def f(a, b, c, x):
4     cdef int i
5     a = b + c
6
7     try:
8         i = 1
9         raise x
10         i = 2
11     except a:
12         i = 3
13
14     try:
15         i = 1
16     except a:
17         i = 2
18     except b:
19         i = 3
20
21     try:
22         i = 1
23     except a, b:
24         i = 2
25
26     try:
27         i = 1
28     except a:
29         i = 2
30     except:
31         i = 3
32
33     try:
34         i = 1
35     except (a, b), c[42]:
36         i = 2
37
38     for a in b:
39         try:
40             c = x * 42
41         except:
42             i = 17
43
44     try:
45         i = 1
46     except:
47         raise
48
49 def g(a, b, c, x):
50     cdef int i
51     a = b + c
52
53     try:
54         i = 1
55         raise x
56         i = 2
57     except a:
58         i = 3
59
60     try:
61         i = 1
62     except a:
63         i = 2
64     except b:
65         i = 3
66
67     try:
68         i = 1
69     except a as b:
70         i = 2
71
72     try:
73         i = 1
74     except a:
75         i = 2
76     except:
77         i = 3
78
79     try:
80         i = 1
81     except (a, b) as c:
82         i = 2
83     except (b, a) as c:
84         i = 3
85     except:
86         i = 4
87     else:
88         i = 5