import traceback, sys
def bar():
raise Exception('Booboo')
def foo():
bar()
try:
foo()
except:
traceback.print_exc()
print 'Got here.'
Result:
Traceback (most recent call last):
File "./foo.py", line 14, in
foo()
File "./foo.py", line 11, in foo
bar()
File "./foo.py", line 8, in bar
raise Exception('Booboo')
Exception: Booboo
Got here.
No comments:
Post a Comment