mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-46996: Remove support of Tcl/Tk < 8.5.12 (GH-31839)
This commit is contained in:
parent
7aeb06f78e
commit
c2e3c06139
10 changed files with 90 additions and 216 deletions
|
@ -28,23 +28,6 @@ __all__ = ["Button", "Checkbutton", "Combobox", "Entry", "Frame", "Label",
|
|||
import tkinter
|
||||
from tkinter import _flatten, _join, _stringify, _splitdict
|
||||
|
||||
# Verify if Tk is new enough to not need the Tile package
|
||||
_REQUIRE_TILE = True if tkinter.TkVersion < 8.5 else False
|
||||
|
||||
def _load_tile(master):
|
||||
if _REQUIRE_TILE:
|
||||
import os
|
||||
tilelib = os.environ.get('TILE_LIBRARY')
|
||||
if tilelib:
|
||||
# append custom tile path to the list of directories that
|
||||
# Tcl uses when attempting to resolve packages with the package
|
||||
# command
|
||||
master.tk.eval(
|
||||
'global auto_path; '
|
||||
'lappend auto_path {%s}' % tilelib)
|
||||
|
||||
master.tk.eval('package require tile') # TclError may be raised here
|
||||
master._tile_loaded = True
|
||||
|
||||
def _format_optvalue(value, script=False):
|
||||
"""Internal function."""
|
||||
|
@ -360,11 +343,6 @@ class Style(object):
|
|||
|
||||
def __init__(self, master=None):
|
||||
master = setup_master(master)
|
||||
|
||||
if not getattr(master, '_tile_loaded', False):
|
||||
# Load tile now, if needed
|
||||
_load_tile(master)
|
||||
|
||||
self.master = master
|
||||
self.tk = self.master.tk
|
||||
|
||||
|
@ -546,9 +524,6 @@ class Widget(tkinter.Widget):
|
|||
readonly, alternate, invalid
|
||||
"""
|
||||
master = setup_master(master)
|
||||
if not getattr(master, '_tile_loaded', False):
|
||||
# Load tile now, if needed
|
||||
_load_tile(master)
|
||||
tkinter.Widget.__init__(self, master, widgetname, kw=kw)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue