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
9cd90cca
Commit
9cd90cca
authored
Sep 25, 2015
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Plain Diff
Merge with 3.5
parents
0931ba22
58b07a60
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
20 deletions
+20
-20
Lib/idlelib/IOBinding.py
Lib/idlelib/IOBinding.py
+10
-10
Lib/idlelib/OutputWindow.py
Lib/idlelib/OutputWindow.py
+1
-1
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+6
-6
Lib/idlelib/ScriptBinding.py
Lib/idlelib/ScriptBinding.py
+2
-2
Lib/idlelib/run.py
Lib/idlelib/run.py
+1
-1
No files found.
Lib/idlelib/IOBinding.py
View file @
9cd90cca
...
@@ -217,7 +217,7 @@ class IOBinding:
...
@@ -217,7 +217,7 @@ class IOBinding:
f
.
seek
(
0
)
f
.
seek
(
0
)
bytes
=
f
.
read
()
bytes
=
f
.
read
()
except
OSError
as
msg
:
except
OSError
as
msg
:
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
master
=
self
.
text
)
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
parent
=
self
.
text
)
return
False
return
False
chars
,
converted
=
self
.
_decode
(
two_lines
,
bytes
)
chars
,
converted
=
self
.
_decode
(
two_lines
,
bytes
)
if
chars
is
None
:
if
chars
is
None
:
...
@@ -266,7 +266,7 @@ class IOBinding:
...
@@ -266,7 +266,7 @@ class IOBinding:
title
=
"Error loading the file"
,
title
=
"Error loading the file"
,
message
=
"The encoding '%s' is not known to this Python "
\
message
=
"The encoding '%s' is not known to this Python "
\
"installation. The file may not display correctly"
%
name
,
"installation. The file may not display correctly"
%
name
,
master
=
self
.
text
)
parent
=
self
.
text
)
enc
=
None
enc
=
None
except
UnicodeDecodeError
:
except
UnicodeDecodeError
:
return
None
,
False
return
None
,
False
...
@@ -321,7 +321,7 @@ class IOBinding:
...
@@ -321,7 +321,7 @@ class IOBinding:
title
=
"Save On Close"
,
title
=
"Save On Close"
,
message
=
message
,
message
=
message
,
default
=
tkMessageBox
.
YES
,
default
=
tkMessageBox
.
YES
,
master
=
self
.
text
)
parent
=
self
.
text
)
if
confirm
:
if
confirm
:
reply
=
"yes"
reply
=
"yes"
self
.
save
(
None
)
self
.
save
(
None
)
...
@@ -381,7 +381,7 @@ class IOBinding:
...
@@ -381,7 +381,7 @@ class IOBinding:
return
True
return
True
except
OSError
as
msg
:
except
OSError
as
msg
:
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
tkMessageBox
.
showerror
(
"I/O Error"
,
str
(
msg
),
master
=
self
.
text
)
parent
=
self
.
text
)
return
False
return
False
def
encode
(
self
,
chars
):
def
encode
(
self
,
chars
):
...
@@ -418,7 +418,7 @@ class IOBinding:
...
@@ -418,7 +418,7 @@ class IOBinding:
tkMessageBox
.
showerror
(
tkMessageBox
.
showerror
(
"I/O Error"
,
"I/O Error"
,
"%s.
\
n
Saving as UTF-8"
%
failed
,
"%s.
\
n
Saving as UTF-8"
%
failed
,
master
=
self
.
text
)
parent
=
self
.
text
)
# Fallback: save as UTF-8, with BOM - ignoring the incorrect
# Fallback: save as UTF-8, with BOM - ignoring the incorrect
# declared encoding
# declared encoding
return
BOM_UTF8
+
chars
.
encode
(
"utf-8"
)
return
BOM_UTF8
+
chars
.
encode
(
"utf-8"
)
...
@@ -433,7 +433,7 @@ class IOBinding:
...
@@ -433,7 +433,7 @@ class IOBinding:
title
=
"Print"
,
title
=
"Print"
,
message
=
"Print to Default Printer"
,
message
=
"Print to Default Printer"
,
default
=
tkMessageBox
.
OK
,
default
=
tkMessageBox
.
OK
,
master
=
self
.
text
)
parent
=
self
.
text
)
if
not
confirm
:
if
not
confirm
:
self
.
text
.
focus_set
()
self
.
text
.
focus_set
()
return
"break"
return
"break"
...
@@ -470,10 +470,10 @@ class IOBinding:
...
@@ -470,10 +470,10 @@ class IOBinding:
status
+
output
status
+
output
if
output
:
if
output
:
output
=
"Printing command: %s
\
n
"
%
repr
(
command
)
+
output
output
=
"Printing command: %s
\
n
"
%
repr
(
command
)
+
output
tkMessageBox
.
showerror
(
"Print status"
,
output
,
master
=
self
.
text
)
tkMessageBox
.
showerror
(
"Print status"
,
output
,
parent
=
self
.
text
)
else
:
#no printing for this platform
else
:
#no printing for this platform
message
=
"Printing is not enabled for this platform: %s"
%
platform
message
=
"Printing is not enabled for this platform: %s"
%
platform
tkMessageBox
.
showinfo
(
"Print status"
,
message
,
master
=
self
.
text
)
tkMessageBox
.
showinfo
(
"Print status"
,
message
,
parent
=
self
.
text
)
if
tempfilename
:
if
tempfilename
:
os
.
unlink
(
tempfilename
)
os
.
unlink
(
tempfilename
)
return
"break"
return
"break"
...
@@ -492,7 +492,7 @@ class IOBinding:
...
@@ -492,7 +492,7 @@ class IOBinding:
def
askopenfile
(
self
):
def
askopenfile
(
self
):
dir
,
base
=
self
.
defaultfilename
(
"open"
)
dir
,
base
=
self
.
defaultfilename
(
"open"
)
if
not
self
.
opendialog
:
if
not
self
.
opendialog
:
self
.
opendialog
=
tkFileDialog
.
Open
(
master
=
self
.
text
,
self
.
opendialog
=
tkFileDialog
.
Open
(
parent
=
self
.
text
,
filetypes
=
self
.
filetypes
)
filetypes
=
self
.
filetypes
)
filename
=
self
.
opendialog
.
show
(
initialdir
=
dir
,
initialfile
=
base
)
filename
=
self
.
opendialog
.
show
(
initialdir
=
dir
,
initialfile
=
base
)
return
filename
return
filename
...
@@ -513,7 +513,7 @@ class IOBinding:
...
@@ -513,7 +513,7 @@ class IOBinding:
dir
,
base
=
self
.
defaultfilename
(
"save"
)
dir
,
base
=
self
.
defaultfilename
(
"save"
)
if
not
self
.
savedialog
:
if
not
self
.
savedialog
:
self
.
savedialog
=
tkFileDialog
.
SaveAs
(
self
.
savedialog
=
tkFileDialog
.
SaveAs
(
master
=
self
.
text
,
parent
=
self
.
text
,
filetypes
=
self
.
filetypes
,
filetypes
=
self
.
filetypes
,
defaultextension
=
self
.
defaultextension
)
defaultextension
=
self
.
defaultextension
)
filename
=
self
.
savedialog
.
show
(
initialdir
=
dir
,
initialfile
=
base
)
filename
=
self
.
savedialog
.
show
(
initialdir
=
dir
,
initialfile
=
base
)
...
...
Lib/idlelib/OutputWindow.py
View file @
9cd90cca
...
@@ -91,7 +91,7 @@ class OutputWindow(EditorWindow):
...
@@ -91,7 +91,7 @@ class OutputWindow(EditorWindow):
"No special line",
"No special line",
"The line you point at doesn'
t
look
like
"
"The line you point at doesn'
t
look
like
"
"
a
valid
file
name
followed
by
a
line
number
.
",
"
a
valid
file
name
followed
by
a
line
number
.
",
master
=self.text)
parent
=self.text)
return
return
filename, lineno = result
filename, lineno = result
edit = self.flist.open(filename)
edit = self.flist.open(filename)
...
...
Lib/idlelib/PyShell.py
View file @
9cd90cca
...
@@ -774,7 +774,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -774,7 +774,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
"Exit?"
,
"Exit?"
,
"Do you want to exit altogether?"
,
"Do you want to exit altogether?"
,
default
=
"yes"
,
default
=
"yes"
,
master
=
self
.
tkconsole
.
text
):
parent
=
self
.
tkconsole
.
text
):
raise
raise
else
:
else
:
self
.
showtraceback
()
self
.
showtraceback
()
...
@@ -812,7 +812,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -812,7 +812,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
"Run IDLE with the -n command line switch to start without a "
"Run IDLE with the -n command line switch to start without a "
"subprocess and refer to Help/IDLE Help 'Running without a "
"subprocess and refer to Help/IDLE Help 'Running without a "
"subprocess' for further details."
,
"subprocess' for further details."
,
master
=
self
.
tkconsole
.
text
)
parent
=
self
.
tkconsole
.
text
)
def
display_no_subprocess_error
(
self
):
def
display_no_subprocess_error
(
self
):
tkMessageBox
.
showerror
(
tkMessageBox
.
showerror
(
...
@@ -820,14 +820,14 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -820,14 +820,14 @@ class ModifiedInterpreter(InteractiveInterpreter):
"IDLE's subprocess didn't make connection. Either IDLE can't "
"IDLE's subprocess didn't make connection. Either IDLE can't "
"start a subprocess or personal firewall software is blocking "
"start a subprocess or personal firewall software is blocking "
"the connection."
,
"the connection."
,
master
=
self
.
tkconsole
.
text
)
parent
=
self
.
tkconsole
.
text
)
def
display_executing_dialog
(
self
):
def
display_executing_dialog
(
self
):
tkMessageBox
.
showerror
(
tkMessageBox
.
showerror
(
"Already executing"
,
"Already executing"
,
"The Python Shell window is already executing a command; "
"The Python Shell window is already executing a command; "
"please wait until it is finished."
,
"please wait until it is finished."
,
master
=
self
.
tkconsole
.
text
)
parent
=
self
.
tkconsole
.
text
)
class
PyShell
(
OutputWindow
):
class
PyShell
(
OutputWindow
):
...
@@ -931,7 +931,7 @@ class PyShell(OutputWindow):
...
@@ -931,7 +931,7 @@ class PyShell(OutputWindow):
if
self
.
executing
:
if
self
.
executing
:
tkMessageBox
.
showerror
(
"Don't debug now"
,
tkMessageBox
.
showerror
(
"Don't debug now"
,
"You can only toggle the debugger when idle"
,
"You can only toggle the debugger when idle"
,
master
=
self
.
text
)
parent
=
self
.
text
)
self
.
set_debugger_indicator
()
self
.
set_debugger_indicator
()
return
"break"
return
"break"
else
:
else
:
...
@@ -1239,7 +1239,7 @@ class PyShell(OutputWindow):
...
@@ -1239,7 +1239,7 @@ class PyShell(OutputWindow):
tkMessageBox.showerror("No stack trace",
tkMessageBox.showerror("No stack trace",
"There is no stack trace yet.
\
n
"
"There is no stack trace yet.
\
n
"
"(sys.last_traceback is not defined)",
"(sys.last_traceback is not defined)",
master
=self.text)
parent
=self.text)
return
return
from idlelib.StackViewer import StackBrowser
from idlelib.StackViewer import StackBrowser
StackBrowser(self.root, self.flist)
StackBrowser(self.root, self.flist)
...
...
Lib/idlelib/ScriptBinding.py
View file @
9cd90cca
...
@@ -197,10 +197,10 @@ class ScriptBinding:
...
@@ -197,10 +197,10 @@ class ScriptBinding:
confirm
=
tkMessageBox
.
askokcancel
(
title
=
"Save Before Run or Check"
,
confirm
=
tkMessageBox
.
askokcancel
(
title
=
"Save Before Run or Check"
,
message
=
msg
,
message
=
msg
,
default
=
tkMessageBox
.
OK
,
default
=
tkMessageBox
.
OK
,
master
=
self
.
editwin
.
text
)
parent
=
self
.
editwin
.
text
)
return
confirm
return
confirm
def
errorbox
(
self
,
title
,
message
):
def
errorbox
(
self
,
title
,
message
):
# XXX This should really be a function of EditorWindow...
# XXX This should really be a function of EditorWindow...
tkMessageBox
.
showerror
(
title
,
message
,
master
=
self
.
editwin
.
text
)
tkMessageBox
.
showerror
(
title
,
message
,
parent
=
self
.
editwin
.
text
)
self
.
editwin
.
text
.
focus_set
()
self
.
editwin
.
text
.
focus_set
()
Lib/idlelib/run.py
View file @
9cd90cca
...
@@ -174,7 +174,7 @@ def show_socket_error(err, address):
...
@@ -174,7 +174,7 @@ def show_socket_error(err, address):
tkMessageBox
.
showerror
(
"IDLE Subprocess Error"
,
msg
,
parent
=
root
)
tkMessageBox
.
showerror
(
"IDLE Subprocess Error"
,
msg
,
parent
=
root
)
else
:
else
:
tkMessageBox
.
showerror
(
"IDLE Subprocess Error"
,
tkMessageBox
.
showerror
(
"IDLE Subprocess Error"
,
"Socket Error: %s"
%
err
.
args
[
1
])
"Socket Error: %s"
%
err
.
args
[
1
]
,
parent
=
root
)
root
.
destroy
()
root
.
destroy
()
def
print_exception
():
def
print_exception
():
...
...
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