Backport of the Python stdlib traceback module