Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python distributions where _tkinter is compiled in #6006

Merged
merged 1 commit into from Mar 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/PIL/_tkinter_finder.py
Expand Up @@ -5,10 +5,15 @@
import warnings
from tkinter import _tkinter as tk

if hasattr(sys, "pypy_find_executable"):
TKINTER_LIB = tk.tklib_cffi.__file__
else:
TKINTER_LIB = tk.__file__
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

tk_version = str(tkinter.TkVersion)
if tk_version == "8.4":
Expand Down