The most underrated feature in Python 3
blog.ionelmc.ro
blog.ionelmc.ro
There are good times to use foo and bar, rather than more self-documenting style placeholder names, but this was not one of them for me.
import sys,traceback
try:
...
except Exception as ex:
exc_type, exc_value, exc_traceback = sys.exc_info()
logger.error("%s:%s" % (str(ex), str(traceback.format_exception(exc_type, exc_value, exc_traceback))))
raise MyException(" :( ")