_tkinter_finder.py 503 B

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