mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-25 19:43:45 +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
|
import sys
|
||||||
|
|
||||||
from PIL import features
|
from PIL import features
|
||||||
|
@ -8,7 +7,11 @@ def test_wheel_modules():
|
||||||
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"}
|
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"}
|
||||||
|
|
||||||
# tkinter is not available in cibuildwheel installed CPython on Windows
|
# 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")
|
expected_modules.remove("tkinter")
|
||||||
|
|
||||||
assert set(features.get_supported_modules()) == expected_modules
|
assert set(features.get_supported_modules()) == expected_modules
|
||||||
|
|
Loading…
Reference in New Issue
Block a user