From 8290e7f48e4caa39295848fa6092eae33d8a96fd Mon Sep 17 00:00:00 2001 From: Jaylon Date: Sat, 11 Apr 2026 20:13:12 +0800 Subject: [PATCH 1/2] Fixed: cbook.py clean_data_and_mask exception type. Replaced except Exception with except(TypeError, ValueError) as the fixme comment addressed --- lib/matplotlib/cbook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 40b47fa55780..91214523ef9b 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -1032,7 +1032,7 @@ def delete_masked_points(*args): mask = np.isfinite(xd) if isinstance(mask, np.ndarray): masks.append(mask) - except Exception: # Fixme: put in tuple of possible exceptions? + except (TypeError, ValueError): # Fixme: put in tuple of possible exceptions? pass if len(masks): mask = np.logical_and.reduce(masks) From de8e26771cb53344939d39be2825c18fc2b7180f Mon Sep 17 00:00:00 2001 From: Jaylon Date: Sat, 11 Apr 2026 20:45:10 +0800 Subject: [PATCH 2/2] Remove outdated FIXME comment --- lib/matplotlib/cbook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 91214523ef9b..ef7f88db50d3 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -1032,7 +1032,7 @@ def delete_masked_points(*args): mask = np.isfinite(xd) if isinstance(mask, np.ndarray): masks.append(mask) - except (TypeError, ValueError): # Fixme: put in tuple of possible exceptions? + except (TypeError, ValueError): pass if len(masks): mask = np.logical_and.reduce(masks)