fork download
  1. import sys
  2.  
  3. def foo():
  4. __import__('idontexist')
  5.  
  6. try:
  7. __import__('idontexist')
  8. except:
  9. print(sys.exc_info()[2].tb_next)
  10.  
  11. try:
  12. foo()
  13. except:
  14. print(sys.exc_info()[2].tb_next)
Success #stdin #stdout 0.05s 9568KB
stdin
Standard input is empty
stdout
None
<traceback object at 0xb72c37fc>