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
361baadd
Commit
361baadd
authored
Jun 02, 2012
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Plain Diff
Merge with 3.2 #10365
parents
07ea53cb
a948c79a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
Lib/idlelib/IOBinding.py
Lib/idlelib/IOBinding.py
+13
-16
No files found.
Lib/idlelib/IOBinding.py
View file @
361baadd
...
...
@@ -157,35 +157,32 @@ class IOBinding:
def
open
(
self
,
event
=
None
,
editFile
=
None
):
flist
=
self
.
editwin
.
flist
# Save in case parent window is closed (ie, during askopenfile()).
if
flist
:
if
not
editFile
:
filename
=
self
.
askopenfile
()
else
:
filename
=
editFile
if
filename
:
# If the current window has no filename and hasn't been
# modified, we replace its contents (no loss). Otherwise
# we open a new window. But we won't replace the
# shell window (which has an interp(reter) attribute), which
# gets set to "not modified" at every new prompt.
# Also, make sure the current window has not been closed,
# since it can be closed during the Open File dialog.
try
:
interp
=
self
.
editwin
.
interp
except
AttributeError
:
interp
=
None
if
self
.
editwin
and
not
self
.
filename
and
\
self
.
get_saved
()
and
not
interp
:
# If editFile is valid and already open, flist.open will
# shift focus to its existing window.
# If the current window exists and is a fresh unnamed,
# unmodified editor window (not an interpreter shell),
# pass self.loadfile to flist.open so it will load the file
# in the current window (if the file is not already open)
# instead of a new window.
if
(
self
.
editwin
and
not
getattr
(
self
.
editwin
,
'interp'
,
None
)
and
not
self
.
filename
and
self
.
get_saved
()):
flist
.
open
(
filename
,
self
.
loadfile
)
else
:
flist
.
open
(
filename
)
else
:
if
self
.
text
:
self
.
text
.
focus_set
()
return
"break"
#
# Code for use outside IDLE:
if
self
.
get_saved
():
reply
=
self
.
maybesave
()
...
...
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