def f2(x, *args, **kwargs):
try:
return 10 / x
except:
return 0
def f1(x):
y = f2(x, truc=3,lol=4)
y = f2(0)
return y + 2
t = traceur.DummyTrace(f1)
t.call(2)
print(t.do_report())
# === Result: ===
=== Entering New Frame f1 (11083448) ===
[]
1 LOAD_GLOBAL 0 f2
[<function f2 at 0x7f196bd9ad48>]
5 LOAD_FAST 0 x
[2, <function f2 at 0x7f196bd9ad48>]
9 LOAD_CONST 1 truc
['truc', 2, <function f2 at 0x7f196bd9ad48>]
13 LOAD_CONST 2 3
[3, 'truc', 2, <function f2 at 0x7f196bd9ad48>]
17 LOAD_CONST 3 lol
['lol', 3, 'truc', 2, <function f2 at 0x7f196bd9ad48>]
21 LOAD_CONST 4 4
[4, 'lol', 3, 'truc', 2, <function f2 at 0x7f196bd9ad48>]
25 CALL_FUNCTION 513 513
=== Entering New Frame f2 (11085976) ===
[]
1 SETUP_EXCEPT 18 22
[]
5 LOAD_CONST 1 10
[10]
9 LOAD_FAST 0 x
[2, 10]
13 BINARY_TRUE_DIVIDE None None
[5.0]
15 RETURN_VALUE None None
=== Returning to Frame f1 11083448===
[5.0]
29 STORE_FAST 1 y
[]
33 LOAD_GLOBAL 0 f2
[<function f2 at 0x7f196bd9ad48>]
37 LOAD_CONST 5 0
[0, <function f2 at 0x7f196bd9ad48>]
41 CALL_FUNCTION 1 1
=== Entering New Frame f2 (11086920) ===
[]
1 SETUP_EXCEPT 18 22
[]
5 LOAD_CONST 1 10
[10]
9 LOAD_FAST 0 x
[0, 10]
13 BINARY_TRUE_DIVIDE None None
[<class 'ZeroDivisionError'>, ZeroDivisionError('division by zero',), <traceback object at 0x7f196b7b1368>, None, None, None]
23 POP_TOP None None
[ZeroDivisionError('division by zero',), <traceback object at 0x7f196b7b1368>, None, None, None]
25 POP_TOP None None
[<traceback object at 0x7f196b7b1368>, None, None, None]
27 POP_TOP None None
[None, None, None]
29 LOAD_CONST 2 0
[0, None, None, None]
33 RETURN_VALUE None None
=== Returning to Frame f1 11083448===
[0]
45 STORE_FAST 1 y
[]
49 LOAD_FAST 1 y
[0]
53 LOAD_CONST 6 2
[2, 0]
57 BINARY_ADD None None
[2]
59 RETURN_VALUE None None
None