2016-05-29 10:29:01 +03:00
|
|
|
""" Find compiled module linking to Tcl / Tk libraries
|
|
|
|
"""
|
|
|
|
import sys
|
2021-01-26 00:01:26 +03:00
|
|
|
import tkinter
|
2019-09-26 15:12:28 +03:00
|
|
|
from tkinter import _tkinter as tk
|
2016-05-29 10:29:01 +03:00
|
|
|
|
2022-04-05 16:33:20 +03:00
|
|
|
from ._deprecate import deprecate
|
|
|
|
|
2022-02-01 22:49:45 +03:00
|
|
|
try:
|
|
|
|
if hasattr(sys, "pypy_find_executable"):
|
|
|
|
TKINTER_LIB = tk.tklib_cffi.__file__
|
|
|
|
else:
|
|
|
|
TKINTER_LIB = tk.__file__
|
|
|
|
except AttributeError:
|
|
|
|
# _tkinter may be compiled directly into Python, in which case __file__ is
|
|
|
|
# not available. load_tkinter_funcs will check the binary first in any case.
|
|
|
|
TKINTER_LIB = None
|
2021-01-26 00:01:26 +03:00
|
|
|
|
|
|
|
tk_version = str(tkinter.TkVersion)
|
2021-01-26 10:14:28 +03:00
|
|
|
if tk_version == "8.4":
|
2022-04-05 16:33:20 +03:00
|
|
|
deprecate(
|
|
|
|
"Support for Tk/Tcl 8.4", 10, action="Please upgrade to Tk/Tcl 8.5 or newer"
|
2021-01-26 10:14:28 +03:00
|
|
|
)
|