mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
replace importlib.util.find_spec with try import except ImportError
This commit is contained in:
parent
6fe42bddd9
commit
e1059767d8
|
@ -1,4 +1,3 @@
|
|||
import importlib.util
|
||||
import sys
|
||||
|
||||
from PIL import features
|
||||
|
@ -8,7 +7,11 @@ def test_wheel_modules():
|
|||
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"}
|
||||
|
||||
# tkinter is not available in cibuildwheel installed CPython on Windows
|
||||
if not importlib.util.find_spec("tkinter"):
|
||||
try:
|
||||
import tkinter
|
||||
|
||||
assert tkinter
|
||||
except ImportError:
|
||||
expected_modules.remove("tkinter")
|
||||
|
||||
assert set(features.get_supported_modules()) == expected_modules
|
||||
|
|
Loading…
Reference in New Issue
Block a user