Skip to content

Instantly share code, notes, and snippets.

@anandology
Created November 7, 2009 06:47
Show Gist options
  • Save anandology/228576 to your computer and use it in GitHub Desktop.
Save anandology/228576 to your computer and use it in GitHub Desktop.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment