1
0

_tkinter_finder.py 540 B

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