Commit 50369215 authored by Andrew Svetlov's avatar Andrew Svetlov

Issue #3035: Unused functions from tkinter are marked as pending peprecated.

parent 5fad9323
...@@ -34,10 +34,14 @@ import sys ...@@ -34,10 +34,14 @@ import sys
if sys.platform == "win32": if sys.platform == "win32":
# Attempt to configure Tcl/Tk without requiring PATH # Attempt to configure Tcl/Tk without requiring PATH
from tkinter import _fix from tkinter import _fix
import warnings
import _tkinter # If this fails your Python may not be configured for Tk import _tkinter # If this fails your Python may not be configured for Tk
TclError = _tkinter.TclError TclError = _tkinter.TclError
from tkinter.constants import * from tkinter.constants import *
wantobjects = 1 wantobjects = 1
TkVersion = float(_tkinter.TK_VERSION) TkVersion = float(_tkinter.TK_VERSION)
...@@ -2118,25 +2122,45 @@ class Button(Widget): ...@@ -2118,25 +2122,45 @@ class Button(Widget):
""" """
return self.tk.call(self._w, 'invoke') return self.tk.call(self._w, 'invoke')
# Indices: # Indices:
# XXX I don't like these -- take them away # XXX I don't like these -- take them away
def AtEnd(): def AtEnd():
warnings.warn("tkinter.AtEnd will be removed in 3.5",
PendingDeprecationWarning, stacklevel=2)
return 'end' return 'end'
def AtInsert(*args): def AtInsert(*args):
warnings.warn("tkinter.AtInsert will be removed in 3.5",
PendingDeprecationWarning, stacklevel=2)
s = 'insert' s = 'insert'
for a in args: for a in args:
if a: s = s + (' ' + a) if a: s = s + (' ' + a)
return s return s
def AtSelFirst(): def AtSelFirst():
warnings.warn("tkinter.AtSelFirst will be removed in 3.5",
PendingDeprecationWarning, stacklevel=2)
return 'sel.first' return 'sel.first'
def AtSelLast(): def AtSelLast():
warnings.warn("tkinter.AtSelLast will be removed in 3.5",
PendingDeprecationWarning, stacklevel=2)
return 'sel.last' return 'sel.last'
def At(x, y=None): def At(x, y=None):
warnings.warn("tkinter.At will be removed in 3.5",
PendingDeprecationWarning, stacklevel=2)
if y is None: if y is None:
return '@%r' % (x,) return '@%r' % (x,)
else: else:
return '@%r,%r' % (x, y) return '@%r,%r' % (x, y)
class Canvas(Widget, XView, YView): class Canvas(Widget, XView, YView):
"""Canvas widget to display graphical elements like lines or text.""" """Canvas widget to display graphical elements like lines or text."""
def __init__(self, master=None, cnf={}, **kw): def __init__(self, master=None, cnf={}, **kw):
......
...@@ -30,6 +30,8 @@ Core and Builtins ...@@ -30,6 +30,8 @@ Core and Builtins
Library Library
------- -------
- Issue #3035: Unused functions from tkinter are marked as pending peprecated.
- Issue #12757: Fix the skipping of doctests when python is run with -OO so - Issue #12757: Fix the skipping of doctests when python is run with -OO so
that it works in unittest's verbose mode as well as non-verbose mode. that it works in unittest's verbose mode as well as non-verbose mode.
......
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