Commit a0ae789f authored by Terry Jan Reedy's avatar Terry Jan Reedy

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.
parent 89f76d3f
...@@ -43,11 +43,6 @@ def _sphinx_version(): ...@@ -43,11 +43,6 @@ def _sphinx_version():
class HelpDialog(object): class HelpDialog(object):
def __init__(self): 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.parent = None # parent of help window
self.dlg = None # the help window iteself self.dlg = None # the help window iteself
...@@ -59,6 +54,11 @@ class HelpDialog(object): ...@@ -59,6 +54,11 @@ class HelpDialog(object):
near - a Toplevel widget (e.g. EditorWindow or PyShell) near - a Toplevel widget (e.g. EditorWindow or PyShell)
to use as a reference for placing the help window 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: if self.dlg is None:
self.show_dialog(parent) self.show_dialog(parent)
if near: if near:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment