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
cd6b8c67
Commit
cd6b8c67
authored
May 26, 2012
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10365: File open dialog now works instead of crashing
even when parent window is closed. Patch by Roger Serwy.
parent
809309a4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
Lib/idlelib/IOBinding.py
Lib/idlelib/IOBinding.py
+12
-5
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+2
-1
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/idlelib/IOBinding.py
View file @
cd6b8c67
...
...
@@ -156,7 +156,8 @@ class IOBinding:
self
.
filename_change_hook
()
def
open
(
self
,
event
=
None
,
editFile
=
None
):
if
self
.
editwin
.
flist
:
flist
=
self
.
editwin
.
flist
if
flist
:
if
not
editFile
:
filename
=
self
.
askopenfile
()
else
:
...
...
@@ -167,16 +168,22 @@ class IOBinding:
# 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
not
self
.
filename
and
self
.
get_saved
()
and
not
interp
:
self
.
editwin
.
flist
.
open
(
filename
,
self
.
loadfile
)
if
self
.
editwin
and
not
self
.
filename
and
\
self
.
get_saved
()
and
not
interp
:
flist
.
open
(
filename
,
self
.
loadfile
)
else
:
self
.
editwin
.
flist
.
open
(
filename
)
flist
.
open
(
filename
)
else
:
if
self
.
text
:
self
.
text
.
focus_set
()
return
"break"
#
# Code for use outside IDLE:
...
...
Lib/idlelib/PyShell.py
View file @
cd6b8c67
...
...
@@ -1435,6 +1435,7 @@ def main():
if
tkversionwarning
:
shell
.
interp
.
runcommand
(
''
.
join
((
"print('"
,
tkversionwarning
,
"')"
)))
while
flist
.
inversedict
:
# keep IDLE running while files are open.
root
.
mainloop
()
root
.
destroy
()
...
...
Misc/NEWS
View file @
cd6b8c67
...
...
@@ -67,6 +67,9 @@ Core and Builtins
Library
-------
- Issue #10365: File open dialog now works instead of crashing
even when parent window is closed. Patch by Roger Serwy.
- Issue #14876: Use user-selected font for highlight configuration.
- Issue #14920: Fix the help(urllib.parse) failure on locale C on terminals.
...
...
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