Author terry.reedy
Recipients Arfrever, brett.cannon, kbk, python-dev, r.david.murray, roger.serwy, terry.reedy, vinay.sajip, vstinner
Date 2013-06-27.01:15:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Here is a patch that looks much bigger than it really is. Idle was written before the warnings module, so the warnings system was conditioned on a successful warnings import. The test is no longer needed, and neither Vinay nor Victor repeated the test at the new location for the warnings.showwarning patch, within PyShell.main and run.main. I just deleted the test and dedented the indented blocks, which were, except for three lines, otherwise unchanged.

For, I copied warnings.showwarnings and changed it to call idle_formatwarnings_subproc instead of (patched) warnings.formatwarnings. I then put the replacement of warnings.showwarnings in main after the sanity checks.

For, I made a similar change in showwarnings and the warnings.showwarnings replacement. I also added AttributeError to the print exception. At least on Windows, warning_stream = sys.__stderr__  is None when Idle is started normally, from an icon. But otherwise changing Idle to stop expecting a writable console is another issue.
Date User Action Args
2013-06-27 01:15:31terry.reedysetrecipients: + terry.reedy, brett.cannon, kbk, vinay.sajip, vstinner, roger.serwy, Arfrever, r.david.murray, python-dev
2013-06-27 01:15:31terry.reedysetmessageid: <>
2013-06-27 01:15:31terry.reedylinkissue18081 messages
2013-06-27 01:15:31terry.reedycreate