summaryrefslogtreecommitdiff
path: root/python/testData/debug/test3.py
blob: 6122a530c610323eacda6097da8162c452cb394d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class A:
    def __init__(self, z):
        self.z = z

    def foo(self, x):
        y = 2 * x + self.z
        return 1 + y


def zoo(x):
    y = int((x - 2) / (x - 1))

    return A(y)

print(zoo(2).foo(2))

try:
    try:
        print(zoo(1).foo(2)) #we got ZeroDivision here
    finally:
        print(zoo(0).foo(2))
except:
    pass

a = zoo(-1)
print(a.foo(2))