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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
Traceback (most recent call last):
File "formatter_example.py", line 21, in foo
9 | x = 1
10 | lst = (
11 | [
12 | x,
(...)
18 | + []
19 | )
20 | try:
--> 21 | return int(str(lst))
22 | except:
ValueError: invalid literal for int() with base 10: '[1]'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "formatter_example.py", line 24, in foo
21 | return int(str(lst))
22 | except:
23 | try:
--> 24 | return 1 / 0
25 | except Exception as e:
ZeroDivisionError: division by zero
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "formatter_example.py", line 30, in bar
29 | def bar():
--> 30 | exec("foo()")
File "<string>", line 1, in <module>
File "formatter_example.py", line 8, in foo
6 | def foo(n=5):
7 | if n > 0:
--> 8 | return foo(n - 1)
9 | x = 1
File "formatter_example.py", line 8, in foo
6 | def foo(n=5):
7 | if n > 0:
--> 8 | return foo(n - 1)
9 | x = 1
[... skipping similar frames: foo at line 8 (2 times)]
File "formatter_example.py", line 8, in foo
6 | def foo(n=5):
7 | if n > 0:
--> 8 | return foo(n - 1)
9 | x = 1
File "formatter_example.py", line 26, in foo
23 | try:
24 | return 1 / 0
25 | except Exception as e:
--> 26 | raise TypeError from e
TypeError
|