summaryrefslogtreecommitdiff
path: root/python/testData/debug/test3.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/testData/debug/test3.py')
-rw-r--r--python/testData/debug/test3.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/python/testData/debug/test3.py b/python/testData/debug/test3.py
new file mode 100644
index 000000000000..6122a530c610
--- /dev/null
+++ b/python/testData/debug/test3.py
@@ -0,0 +1,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)) \ No newline at end of file