This is the bug:
if not isinstance(exc_tb, str) and exc_tb is not None:
exc_tb is a unicode object, not str.
This is the bug:
if not isinstance(exc_tb, str) and exc_tb is not None:
exc_tb is a unicode object, not str.