File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11What's New in IDLE 3.3?
22=========================
33
4+ - Issue #8515: Set __file__ when run file in IDLE.
5+ Initial patch by Bruce Frederiksen.
6+
47- IDLE can be launched as `python -m idlelib`
58
69- Issue #14409: IDLE now properly executes commands in the Shell window
Original file line number Diff line number Diff line change @@ -150,16 +150,16 @@ def _run_module_event(self, event):
150150 dirname = os .path .dirname (filename )
151151 # XXX Too often this discards arguments the user just set...
152152 interp .runcommand ("""if 1:
153- _filename = %r
153+ __file__ = {filename!r}
154154 import sys as _sys
155155 from os.path import basename as _basename
156156 if (not _sys.argv or
157- _basename(_sys.argv[0]) != _basename(_filename )):
158- _sys.argv = [_filename ]
157+ _basename(_sys.argv[0]) != _basename(__file__ )):
158+ _sys.argv = [__file__ ]
159159 import os as _os
160- _os.chdir(%r )
161- del _filename, _sys, _basename, _os
162- \n """ % (filename , dirname ))
160+ _os.chdir({dirname!r} )
161+ del _sys, _basename, _os
162+ \n """ . format (filename = filename , dirname = dirname ))
163163 interp .prepend_syspath (filename )
164164 # XXX KBK 03Jul04 When run w/o subprocess, runtime warnings still
165165 # go to __stderr__. With subprocess, they go to the shell.
Original file line number Diff line number Diff line change @@ -333,6 +333,7 @@ Doug Fort
333333John Fouhy
334334Andrew Francis
335335Martin Franklin
336+ Bruce Frederiksen
336337Robin Friedrich
337338Ivan Frohne
338339Matthias Fuchs
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ Core and Builtins
1919Library
2020-------
2121
22+ - Issue #8515: Set __file__ when run file in IDLE.
23+ Initial patch by Bruce Frederiksen.
24+
2225- Issue #14496: Fix wrong name in idlelib/tabbedpages.py.
2326 Patch by Popa Claudiu.
2427
You can’t perform that action at this time.
0 commit comments