Refactor testtools.compat._format_exc_info into two separate functions.