]> granicus.if.org Git - python/commit
bpo-32984: IDLE - set __file__ for startup files (GH-5981)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 5 Mar 2018 19:23:08 +0000 (11:23 -0800)
committerGitHub <noreply@github.com>
Mon, 5 Mar 2018 19:23:08 +0000 (11:23 -0800)
commit6935a511670797a3aaebdf96aad3dcff66baa76e
treef60c0fbcefbf6cde9672709161ae3962b9930c3a
parent73a43960c7be50e136c5482404980175cb99f611
bpo-32984: IDLE - set __file__ for startup files (GH-5981)

Like Python, IDLE optionally runs one startup file in the Shell window
before presenting the first interactive input prompt.  For IDLE,
option -s runs a file named in environmental variable IDLESTARTUP or
PYTHONSTARTUP; -r file runs file.  Python sets __file__ to the startup
file name before running the file and unsets it before the first
prompt.  IDLE now does the same when run normally, without the -n
option.
(cherry picked from commit 22c82be5df70c3d51e3f89b54fe1d4fb84728c1e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Lib/idlelib/pyshell.py
Misc/NEWS.d/next/IDLE/2018-03-05-01-29-05.bpo-32984.NGjgT4.rst [new file with mode: 0644]