This patch makes code.py InteractiveInterpreter use sys.excepthook to display exceptions. This way if a user changes sys.excepthook it will be used by the InteractiveInterpreter.
Logged In: YES user_id=6656 Seems like a good idea to me. The only quibble around the area of self.write -- it might break code that overrides that (IDLE?). Also, shouldn't showsyntaxerror be changed too?
Logged In: YES user_id=358087 OK. Changed syntaxerror as well (see attached patch). Not sure I understand the comment about self.write. Overiding sys.excepthook in IDLE does *not* work. (sys.displayhook does though).
Logged In: YES user_id=6656 > Not sure I understand the comment about self.write. > Overiding sys.excepthook in IDLE does *not* work. > (sys.displayhook does though). Yeah, sure, your patch changes that, but I think that with your patch idle will need to install its own sys.excepthook or exception messages will end up on the real stderr.