From 7a7f0f19093ceb26bd1537c86d0ec1b1e67ec0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Tue, 22 Aug 2023 19:36:24 +0200 Subject: [PATCH] BUG: fix error message when trying to use a feature that requires cartopy while it's missing --- yt/utilities/on_demand_imports.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt/utilities/on_demand_imports.py b/yt/utilities/on_demand_imports.py index 8abe925af84..03919271eae 100644 --- a/yt/utilities/on_demand_imports.py +++ b/yt/utilities/on_demand_imports.py @@ -172,8 +172,8 @@ class NotCartopy(NotAModule): for cartopy imports. """ - def __init__(self, pkg_name): - self.pkg_name = pkg_name + def __init__(self, pkg_name, exc: Optional[BaseException] = None): + super().__init__(pkg_name, exc) if any(s in sys.version for s in ("Anaconda", "Continuum")): # the conda-based installs of cartopy don't have issues with the # GEOS library, so the error message for users with conda can be