From cde6baf25ca55aabb8ad031c7b42d38e37a6f1ac Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Wed, 8 Nov 2023 17:20:37 -0600 Subject: [PATCH] Expand 3D import to handle any exception not just ImportError Needed for the same reasons as #27178 (Namely that we should not be failing on import just because mpl_toolkits is broken), but mpl 3.6 presents with an AttributeError rather than ImportError See discussion in #26827 and #27289 Just expanded liberally in case there are other presentations we have not seen --- lib/matplotlib/projections/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/projections/__init__.py b/lib/matplotlib/projections/__init__.py index 8ce118986065..4c5ef8e2508d 100644 --- a/lib/matplotlib/projections/__init__.py +++ b/lib/matplotlib/projections/__init__.py @@ -58,7 +58,7 @@ try: from mpl_toolkits.mplot3d import Axes3D -except ImportError: +except Exception: import warnings warnings.warn("Unable to import Axes3D. This may be due to multiple versions of " "Matplotlib being installed (e.g. as a system package and as a pip "