From 6bd55684e0d172749a74dd2098ebc18ce5f34fdd Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Tue, 10 Jun 2025 16:00:08 +1000 Subject: [PATCH] Only accept missing tkinter when building wheels on Windows (#8981) --- Tests/check_wheel.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Tests/check_wheel.py b/Tests/check_wheel.py index 8ba40ba3f..9602410da 100644 --- a/Tests/check_wheel.py +++ b/Tests/check_wheel.py @@ -11,13 +11,14 @@ from .helper import is_pypy def test_wheel_modules() -> None: expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"} - # tkinter is not available in cibuildwheel installed CPython on Windows - try: - import tkinter + if sys.platform == "win32": + # tkinter is not available in cibuildwheel installed CPython on Windows + try: + import tkinter - assert tkinter - except ImportError: - expected_modules.remove("tkinter") + assert tkinter + except ImportError: + expected_modules.remove("tkinter") assert set(features.get_supported_modules()) == expected_modules