From ae5576bc09b29f66c0919cee99dc1b85305c2eaa Mon Sep 17 00:00:00 2001 From: Bill Blum Date: Wed, 2 Nov 2022 06:14:45 -0400 Subject: [PATCH 1/2] Suppressing two instances of pylint W0703 broad-except. 32 more to check. --- pandas/_testing/_io.py | 2 +- pandas/core/dtypes/cast.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_testing/_io.py b/pandas/_testing/_io.py index 9ad0d13e7317e..3b9e977548e57 100644 --- a/pandas/_testing/_io.py +++ b/pandas/_testing/_io.py @@ -225,7 +225,7 @@ def wrapper(*args, **kwargs): ) try: return t(*args, **kwargs) - except Exception as err: + except Exception as err: # pylint: disable=broad-except errno = getattr(err, "errno", None) if not errno and hasattr(errno, "reason"): # error: "Exception" has no attribute "reason" diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index 54fa9629fecd4..537f02a9fbaab 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -494,7 +494,7 @@ def maybe_cast_to_extension_array( try: result = cls._from_sequence(obj, dtype=dtype) - except Exception: + except Exception: # pylint: disable=broadexcept # We can't predict what downstream EA constructors may raise result = obj return result From bd1c43aa6155b377459a2cea40067807021db8cd Mon Sep 17 00:00:00 2001 From: Bill Blum Date: Wed, 2 Nov 2022 06:33:37 -0400 Subject: [PATCH 2/2] Ran pre-commit, fixed spacing. --- pandas/_testing/_io.py | 2 +- pandas/core/dtypes/cast.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_testing/_io.py b/pandas/_testing/_io.py index 3b9e977548e57..bef2730ec630b 100644 --- a/pandas/_testing/_io.py +++ b/pandas/_testing/_io.py @@ -225,7 +225,7 @@ def wrapper(*args, **kwargs): ) try: return t(*args, **kwargs) - except Exception as err: # pylint: disable=broad-except + except Exception as err: # pylint: disable=broad-except errno = getattr(err, "errno", None) if not errno and hasattr(errno, "reason"): # error: "Exception" has no attribute "reason" diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index 537f02a9fbaab..4426be266bb69 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -494,7 +494,7 @@ def maybe_cast_to_extension_array( try: result = cls._from_sequence(obj, dtype=dtype) - except Exception: # pylint: disable=broadexcept + except Exception: # pylint: disable=broad-except # We can't predict what downstream EA constructors may raise result = obj return result