diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2015-09-23 02:59:40 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2015-09-23 02:59:40 (GMT) |
commit | a0ae789fd4ba403be865a71aefa5dc7c4c50c502 (patch) | |
tree | 30942af4e2ea61902de89be3c2101d5e55760102 /Lib/idlelib/EditorWindow.py | |
parent | 89f76d3f913e0527fbcc0d15cb3c17fbf6ca8618 (diff) | |
download | cpython-a0ae789fd4ba403be865a71aefa5dc7c4c50c502.zip cpython-a0ae789fd4ba403be865a71aefa5dc7c4c50c502.tar.gz cpython-a0ae789fd4ba403be865a71aefa5dc7c4c50c502.tar.bz2 |
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.
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index dacb843..74a4749 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -43,11 +43,6 @@ def _sphinx_version(): 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 @@ class HelpDialog(object): 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: |