diff options
author | Florian Bruhin <me@the-compiler.org> | 2024-04-30 19:24:25 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2024-04-30 19:24:25 +0200 |
commit | 3d96fc2656b372474c4f302617333bf2bb3e9cde (patch) | |
tree | 25fc6ee188aaadb1128e3cd956c5beed828d372e /qutebrowser | |
parent | 4fdc32ffe13fee65d2e0fe1ac697197089e09bad (diff) | |
download | qutebrowser-3d96fc2656b372474c4f302617333bf2bb3e9cde.tar.gz qutebrowser-3d96fc2656b372474c4f302617333bf2bb3e9cde.zip |
Make qt.machinery.Unavailable inherit ModuleNotFoundError
With pytest 8.2, pytest.importorskip(...) now only considers ModuleNotFoundError
rather than all ImportErrors, and warns otherwise:
https://github.com/pytest-dev/pytest/pull/12220
While we could override this via
pytest.importorskip(..., exc_type=machinery.Unavailable)
this is a simpler solution, and it also makes more sense semantically:
We only raise Unavailable when an import is being done that would otherwise
result in a ModuleNotFoundError anyways (e.g. trying to import QtWebKit on Qt
6).
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/qt/machinery.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qutebrowser/qt/machinery.py b/qutebrowser/qt/machinery.py index 9f45dd6ce..45a1f6598 100644 --- a/qutebrowser/qt/machinery.py +++ b/qutebrowser/qt/machinery.py @@ -48,7 +48,7 @@ class Error(Exception): """Base class for all exceptions in this module.""" -class Unavailable(Error, ImportError): +class Unavailable(Error, ModuleNotFoundError): """Raised when a module is unavailable with the given wrapper.""" |