anandology (owner)

Revisions

gist: 228576 Download_button fork
public
Public Clone URL: git://gist.github.com/228576.git
Embed All Files: show embed
format_tb.py #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def f(x):
    def g(y):
        fail
    return g
 
def format_tb(tb):
   # this should get value of x
 
f1 = f(1)
try:
    f1()
except:
    tb = sys.exc_info()[-1]
    print format_tb(tb)