Issue 8388: None shouldn't be passed to traceback.format_exception (original) (raw)

When porting recent unittest patches to py3k, I encountered a failure in testBufferOutputAddErrorOrFailure. The reason is that the test passes None to traceback.format_exception, which works by accident in 2.x.

I added these lines in _exc_info_to_string to fix it: chain = exctype is not None msgLines = traceback.format_exception(exctype, value, tb, chain=chain)

It would be nice if the nice didn't have to rely on that behavior and that hack could be removed.