[Python-checkins] cpython (2.7): Issue #22061: Add deprecation warnings in empty obsolete methods.

serhiy.storchaka python-checkins at python.org
Fri Jul 25 11:31:55 CEST 2014


http://hg.python.org/cpython/rev/f7c84674bdec
changeset:   91848:f7c84674bdec
branch:      2.7
parent:      91845:3c4d45f73622
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Jul 25 12:23:08 2014 +0300
summary:
  Issue #22061: Add deprecation warnings in empty obsolete methods.

files:
  Lib/lib-tk/Tkinter.py |  11 +++++++++--
  1 files changed, 9 insertions(+), 2 deletions(-)


diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -425,7 +425,10 @@
               + _flatten(args) + _flatten(kw.items()))
     def tk_menuBar(self, *args):
         """Do not use. Needed in Tk 3.6 and earlier."""
-        pass # obsolete since Tk 4.0
+        # obsolete since Tk 4.0
+        import warnings
+        warnings.warn('tk_menuBar() does nothing and will be removed in 3.6',
+                      DeprecationWarning, stacklevel=2)
     def wait_variable(self, name='PY_VAR'):
         """Wait until the variable is modified.
 
@@ -2657,7 +2660,11 @@
         selectcolor, takefocus, tearoff, tearoffcommand, title, type."""
         Widget.__init__(self, master, 'menu', cnf, kw)
     def tk_bindForTraversal(self):
-        pass # obsolete since Tk 4.0
+        # obsolete since Tk 4.0
+        import warnings
+        warnings.warn('tk_bindForTraversal() does nothing and '
+                      'will be removed in 3.6',
+                      DeprecationWarning, stacklevel=2)
     def tk_mbPost(self):
         self.tk.call('tk_mbPost', self._w)
     def tk_mbUnpost(self):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list