Skip to content

Instantly share code, notes, and snippets.

@albertz
Last active October 22, 2015 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertz/922622 to your computer and use it in GitHub Desktop.
Save albertz/922622 to your computer and use it in GitHub Desktop.
better_exchook.py output, see https://github.com/albertz/py_better_exchook
$ python better_exchook.py
EXCEPTION
Traceback (most recent call last):
File "better_exchook.py", line 478, in <module>
line: f()
locals:
f = <local> <function f at 0x107f1de60>
File "better_exchook.py", line 477, in f
line: x, 42, sys.stdin.__class__, sys.exc_info, y, z
locals:
x = <global> {'a': 'b', 1: 2}
sys = <global> <module 'sys' (built-in)>
sys.stdin = <global> <open file '<stdin>', mode 'r' at 0x107d9f0c0>
sys.stdin.__class__ = <global> <type 'file'>
sys.exc_info = <global> <built-in function exc_info>
y = <local> 'foo'
z = <not found>
NameError: global name 'z' is not defined
EXCEPTION
Traceback (most recent call last):
File "better_exchook.py", line 484, in <module>
line: f(x, y)
locals:
f = <local> <function <lambda> at 0x107f1df50>
x = <local> {'a': 'b', 1: 2}
y = <not found>
NameError: name 'y' is not defined
EXCEPTION
Traceback (most recent call last):
File "better_exchook.py", line 490, in <module>
line: (lambda x: None)(__name__,
42) # multiline
locals:
x = <local> {'a': 'b', 1: 2}
__name__ = <local> '__main__', len = 8
TypeError: <lambda>() takes exactly 1 argument (2 given)
EXCEPTION
Traceback (most recent call last):
File "better_exchook.py", line 497, in <module>
line: finalfail(sys)
locals:
finalfail = <not found>
sys = <local> <module 'sys' (built-in)>
NameError: name 'finalfail' is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment