Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cd90cc

Browse files
committed
Merge with 3.5
2 parents 0931ba2 + 58b07a6 commit 9cd90cc

5 files changed

Lines changed: 20 additions & 20 deletions

File tree

Lib/idlelib/IOBinding.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def loadfile(self, filename):
217217
f.seek(0)
218218
bytes = f.read()
219219
except OSError as msg:
220-
tkMessageBox.showerror("I/O Error", str(msg), master=self.text)
220+
tkMessageBox.showerror("I/O Error", str(msg), parent=self.text)
221221
return False
222222
chars, converted = self._decode(two_lines, bytes)
223223
if chars is None:
@@ -266,7 +266,7 @@ def _decode(self, two_lines, bytes):
266266
title="Error loading the file",
267267
message="The encoding '%s' is not known to this Python "\
268268
"installation. The file may not display correctly" % name,
269-
master = self.text)
269+
parent = self.text)
270270
enc = None
271271
except UnicodeDecodeError:
272272
return None, False
@@ -321,7 +321,7 @@ def maybesave(self):
321321
title="Save On Close",
322322
message=message,
323323
default=tkMessageBox.YES,
324-
master=self.text)
324+
parent=self.text)
325325
if confirm:
326326
reply = "yes"
327327
self.save(None)
@@ -381,7 +381,7 @@ def writefile(self, filename):
381381
return True
382382
except OSError as msg:
383383
tkMessageBox.showerror("I/O Error", str(msg),
384-
master=self.text)
384+
parent=self.text)
385385
return False
386386

387387
def encode(self, chars):
@@ -418,7 +418,7 @@ def encode(self, chars):
418418
tkMessageBox.showerror(
419419
"I/O Error",
420420
"%s.\nSaving as UTF-8" % failed,
421-
master = self.text)
421+
parent = self.text)
422422
# Fallback: save as UTF-8, with BOM - ignoring the incorrect
423423
# declared encoding
424424
return BOM_UTF8 + chars.encode("utf-8")
@@ -433,7 +433,7 @@ def print_window(self, event):
433433
title="Print",
434434
message="Print to Default Printer",
435435
default=tkMessageBox.OK,
436-
master=self.text)
436+
parent=self.text)
437437
if not confirm:
438438
self.text.focus_set()
439439
return "break"
@@ -470,10 +470,10 @@ def print_window(self, event):
470470
status + output
471471
if output:
472472
output = "Printing command: %s\n" % repr(command) + output
473-
tkMessageBox.showerror("Print status", output, master=self.text)
473+
tkMessageBox.showerror("Print status", output, parent=self.text)
474474
else: #no printing for this platform
475475
message = "Printing is not enabled for this platform: %s" % platform
476-
tkMessageBox.showinfo("Print status", message, master=self.text)
476+
tkMessageBox.showinfo("Print status", message, parent=self.text)
477477
if tempfilename:
478478
os.unlink(tempfilename)
479479
return "break"
@@ -492,7 +492,7 @@ def print_window(self, event):
492492
def askopenfile(self):
493493
dir, base = self.defaultfilename("open")
494494
if not self.opendialog:
495-
self.opendialog = tkFileDialog.Open(master=self.text,
495+
self.opendialog = tkFileDialog.Open(parent=self.text,
496496
filetypes=self.filetypes)
497497
filename = self.opendialog.show(initialdir=dir, initialfile=base)
498498
return filename
@@ -513,7 +513,7 @@ def asksavefile(self):
513513
dir, base = self.defaultfilename("save")
514514
if not self.savedialog:
515515
self.savedialog = tkFileDialog.SaveAs(
516-
master=self.text,
516+
parent=self.text,
517517
filetypes=self.filetypes,
518518
defaultextension=self.defaultextension)
519519
filename = self.savedialog.show(initialdir=dir, initialfile=base)

Lib/idlelib/OutputWindow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def goto_file_line(self, event=None):
9191
"No special line",
9292
"The line you point at doesn't look like "
9393
"a valid file name followed by a line number.",
94-
master=self.text)
94+
parent=self.text)
9595
return
9696
filename, lineno = result
9797
edit = self.flist.open(filename)

Lib/idlelib/PyShell.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ def runcode(self, code):
774774
"Exit?",
775775
"Do you want to exit altogether?",
776776
default="yes",
777-
master=self.tkconsole.text):
777+
parent=self.tkconsole.text):
778778
raise
779779
else:
780780
self.showtraceback()
@@ -812,22 +812,22 @@ def display_port_binding_error(self):
812812
"Run IDLE with the -n command line switch to start without a "
813813
"subprocess and refer to Help/IDLE Help 'Running without a "
814814
"subprocess' for further details.",
815-
master=self.tkconsole.text)
815+
parent=self.tkconsole.text)
816816

817817
def display_no_subprocess_error(self):
818818
tkMessageBox.showerror(
819819
"Subprocess Startup Error",
820820
"IDLE's subprocess didn't make connection. Either IDLE can't "
821821
"start a subprocess or personal firewall software is blocking "
822822
"the connection.",
823-
master=self.tkconsole.text)
823+
parent=self.tkconsole.text)
824824

825825
def display_executing_dialog(self):
826826
tkMessageBox.showerror(
827827
"Already executing",
828828
"The Python Shell window is already executing a command; "
829829
"please wait until it is finished.",
830-
master=self.tkconsole.text)
830+
parent=self.tkconsole.text)
831831

832832

833833
class PyShell(OutputWindow):
@@ -931,7 +931,7 @@ def toggle_debugger(self, event=None):
931931
if self.executing:
932932
tkMessageBox.showerror("Don't debug now",
933933
"You can only toggle the debugger when idle",
934-
master=self.text)
934+
parent=self.text)
935935
self.set_debugger_indicator()
936936
return "break"
937937
else:
@@ -1239,7 +1239,7 @@ def open_stack_viewer(self, event=None):
12391239
tkMessageBox.showerror("No stack trace",
12401240
"There is no stack trace yet.\n"
12411241
"(sys.last_traceback is not defined)",
1242-
master=self.text)
1242+
parent=self.text)
12431243
return
12441244
from idlelib.StackViewer import StackBrowser
12451245
StackBrowser(self.root, self.flist)

Lib/idlelib/ScriptBinding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ def ask_save_dialog(self):
197197
confirm = tkMessageBox.askokcancel(title="Save Before Run or Check",
198198
message=msg,
199199
default=tkMessageBox.OK,
200-
master=self.editwin.text)
200+
parent=self.editwin.text)
201201
return confirm
202202

203203
def errorbox(self, title, message):
204204
# XXX This should really be a function of EditorWindow...
205-
tkMessageBox.showerror(title, message, master=self.editwin.text)
205+
tkMessageBox.showerror(title, message, parent=self.editwin.text)
206206
self.editwin.text.focus_set()

Lib/idlelib/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def show_socket_error(err, address):
174174
tkMessageBox.showerror("IDLE Subprocess Error", msg, parent=root)
175175
else:
176176
tkMessageBox.showerror("IDLE Subprocess Error",
177-
"Socket Error: %s" % err.args[1])
177+
"Socket Error: %s" % err.args[1], parent=root)
178178
root.destroy()
179179

180180
def print_exception():

0 commit comments

Comments
 (0)