File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import os
66import re
77import sys
8- import imp
8+ import importlib . util
99import shutil
1010import tempfile
1111import textwrap
@@ -452,11 +452,15 @@ def test_environment():
452452
453453 if sys .version_info >= (3 , 11 ):
454454 # NOTE: Qt6 is only available for python 3.11 and above
455- imp .find_module ("PySide6" )
456- imp .find_module ("PyQt6" )
455+ if importlib .util .find_spec ("PySide6" ) is None :
456+ raise ImportError ("No module named 'PySide6'" )
457+ if importlib .util .find_spec ("PyQt6" ) is None :
458+ raise ImportError ("No module named 'PyQt6'" )
457459 else :
458- imp .find_module ("PySide2" )
459- imp .find_module ("PyQt5" )
460+ if importlib .util .find_spec ("PySide2" ) is None :
461+ raise ImportError ("No module named 'PySide2'" )
462+ if importlib .util .find_spec ("PyQt5" ) is None :
463+ raise ImportError ("No module named 'PyQt5'" )
460464
461465
462466def test_load_ui_returntype ():
You can’t perform that action at this time.
0 commit comments