(original) (raw)
changeset: 98205:c607004a98bf branch: 3.4 parent: 98201:ff7aba08ada6 user: Terry Jan Reedy tjreedy@udel.edu date: Tue Sep 22 22:59:40 2015 -0400 files: Lib/idlelib/EditorWindow.py description: Issue #16893: Move idlelib.EditorWindow.HelpDialog deprecation warning so it is not triggered on import. The problem is creation of a now-unused instance "helpDialog = HelpDialog()", left for back compatibility. So instead trigger the warning when that instance or another is used. diff -r ff7aba08ada6 -r c607004a98bf Lib/idlelib/EditorWindow.py --- a/Lib/idlelib/EditorWindow.py Wed Sep 23 01:14:35 2015 +0000 +++ b/Lib/idlelib/EditorWindow.py Tue Sep 22 22:59:40 2015 -0400 @@ -43,11 +43,6 @@ class HelpDialog(object): def __init__(self): - import warnings as w - w.warn("EditorWindow.HelpDialog is no longer used by Idle.\n" - "It will be removed in 3.6 or later.\n" - "It has been replaced by private help.HelpWindow\n", - DeprecationWarning, stacklevel=2) self.parent = None # parent of help window self.dlg = None # the help window iteself @@ -59,6 +54,11 @@ near - a Toplevel widget (e.g. EditorWindow or PyShell) to use as a reference for placing the help window """ + import warnings as w + w.warn("EditorWindow.HelpDialog is no longer used by Idle.\n" + "It will be removed in 3.6 or later.\n" + "It has been replaced by private help.HelpWindow\n", + DeprecationWarning, stacklevel=2) if self.dlg is None: self.show_dialog(parent) if near: /tjreedy@udel.edu