That's not necessary. If the object is not callable, the call in handle_uncaught_exception(), line 742, will raise a TypeError, and a traceback will be printed (mentioning the fact that it's not callable, which helps debugging). The check for None is for backward-compatibility with the current behavior.

There is, however, an issue in case the "excepthook" attribute is actually missing. In that case, the generated AttributeError would override the exception that happened in the callback. So the call to PyErr_Fetch() should be taken out of the conditional. I'll send an update shortly.