Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dfe980bb
Commit
dfe980bb
authored
Apr 05, 2012
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #8515: Set __file__ when run file in IDLE.
parent
0130ad14
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
Lib/idlelib/NEWS.txt
Lib/idlelib/NEWS.txt
+3
-0
Lib/idlelib/ScriptBinding.py
Lib/idlelib/ScriptBinding.py
+6
-6
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/idlelib/NEWS.txt
View file @
dfe980bb
What's New in IDLE 3.3?
=========================
- Issue #8515: Set __file__ when run file in IDLE.
Initial patch by Bruce Frederiksen.
- IDLE can be launched as `python -m idlelib`
- Issue #14409: IDLE now properly executes commands in the Shell window
...
...
Lib/idlelib/ScriptBinding.py
View file @
dfe980bb
...
...
@@ -150,16 +150,16 @@ class ScriptBinding:
dirname
=
os
.
path
.
dirname
(
filename
)
# XXX Too often this discards arguments the user just set...
interp
.
runcommand
(
"""if 1:
_
filename = %r
_
_file__ = {filename!r}
import sys as _sys
from os.path import basename as _basename
if (not _sys.argv or
_basename(_sys.argv[0]) != _basename(_
filename
)):
_sys.argv = [_
filename
]
_basename(_sys.argv[0]) != _basename(_
_file__
)):
_sys.argv = [_
_file__
]
import os as _os
_os.chdir(
%r
)
del _
filename, _
sys, _basename, _os
\
n
"""
%
(
filename
,
dirname
))
_os.chdir(
{dirname!r}
)
del _sys, _basename, _os
\
n
"""
.
format
(
filename
=
filename
,
dirname
=
dirname
))
interp
.
prepend_syspath
(
filename
)
# XXX KBK 03Jul04 When run w/o subprocess, runtime warnings still
# go to __stderr__. With subprocess, they go to the shell.
...
...
Misc/ACKS
View file @
dfe980bb
...
...
@@ -333,6 +333,7 @@ Doug Fort
John Fouhy
Andrew Francis
Martin Franklin
Bruce Frederiksen
Robin Friedrich
Ivan Frohne
Matthias Fuchs
...
...
Misc/NEWS
View file @
dfe980bb
...
...
@@ -19,6 +19,9 @@ Core and Builtins
Library
-------
- Issue #8515: Set __file__ when run file in IDLE.
Initial patch by Bruce Frederiksen.
- Issue #14496: Fix wrong name in idlelib/tabbedpages.py.
Patch by Popa Claudiu.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment