codekingpro/portable-devtools
114k
1"""Find compiled module linking to Tcl / Tk libraries"""
2
3from __future__ import annotations
4
5import sys
6import tkinter
7
8tk = getattr(tkinter, "_tkinter")
9
10try:
11 if hasattr(sys, "pypy_find_executable"):
12 TKINTER_LIB = tk.tklib_cffi.__file__
13 else:
14 TKINTER_LIB = tk.__file__
15except AttributeError:
16 # _tkinter may be compiled directly into Python, in which case __file__ is
17 # not available. load_tkinter_funcs will check the binary first in any case.
18 TKINTER_LIB = None
19
20tk_version = str(tkinter.TkVersion)
21 