diff --git a/src/geovista/qt.py b/src/geovista/qt.py index 2ac441c3..7c869dfd 100644 --- a/src/geovista/qt.py +++ b/src/geovista/qt.py @@ -11,7 +11,7 @@ try: import pyvistaqt as pvqt -except ImportError as e: +except ModuleNotFoundError as e: e.msg = f'{e.msg} - please install the "pyvistaqt" and "pyqt" packages.' raise diff --git a/tests/test_qt.py b/tests/test_qt.py index c8e62a04..d7bc6247 100644 --- a/tests/test_qt.py +++ b/tests/test_qt.py @@ -15,12 +15,12 @@ def test_pyvistaqt_import(): """ try: import pyvistaqt - except ImportError: + except ModuleNotFoundError: pyvistaqt = False if not pyvistaqt: emsg = 'please install the "pyvistaqt" and "pyqt" packages' - with pytest.raises(ImportError, match=emsg): + with pytest.raises(ModuleNotFoundError, match=emsg): import geovista.qt # noqa: F401