Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # no callstack, we directly crash through to the intepreter
- >>> raise ValueError()
- Traceback (most recent call last):
- File "<input>", line 1, in <module>
- ValueError
- # we raise in a function, we crash to line two, which called the function
- >>> def a():
- ... raise ValueError()
- ...
- >>> a()
- Traceback (most recent call last):
- File "<input>", line 1, in <module>
- File "<input>", line 2, in d
- ValueError
- # now the long (but not much more complicated) version, if we crash we just go to the most recent call site
- >>> def d():
- ... raise ValueError()
- ... def c():
- ... d()
- ... def b():
- ... c()
- ... def a():
- ... b()
- ...
- >>> a()
- Traceback (most recent call last):
- File "<input>", line 1, in <module>
- File "<input>", line 8, in a
- File "<input>", line 6, in b
- File "<input>", line 4, in c
- File "<input>", line 2, in d
- ValueError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement