Created
November 7, 2009 06:47
-
-
Save anandology/228576 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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