Message191925
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 run.py, 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 PyShell.py, 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:31 | terry.reedy | set | recipients:
+ terry.reedy, brett.cannon, kbk, vinay.sajip, vstinner, roger.serwy, Arfrever, r.david.murray, python-dev |
2013-06-27 01:15:31 | terry.reedy | set | messageid: <1372295731.58.0.482831196216.issue18081@psf.upfronthosting.co.za> |
2013-06-27 01:15:31 | terry.reedy | link | issue18081 messages |
2013-06-27 01:15:31 | terry.reedy | create | |
|