From e5aecf281c8f7644227190254c164601bec21465 Mon Sep 17 00:00:00 2001 From: Kotesh Kumar Yelamati Date: Thu, 23 Jul 2026 18:01:29 -0400 Subject: [PATCH] fix: replace bare except clauses with except Exception in inspection.py --- bpython/inspection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bpython/inspection.py b/bpython/inspection.py index d3e2d5e5..5f466d28 100644 --- a/bpython/inspection.py +++ b/bpython/inspection.py @@ -269,7 +269,7 @@ def getfuncprops(func: str, f: Callable) -> FuncProps | None: # not take 'self', the latter would: try: func_name = getattr(f, "__name__", None) - except: + except Exception: # if calling foo.__name__ would result in an error func_name = None @@ -279,7 +279,7 @@ def getfuncprops(func: str, f: Callable) -> FuncProps | None: or (func_name == "__init__" and not func.endswith(".__init__")) or (func_name == "__new__" and not func.endswith(".__new__")) ) - except: + except Exception: # if f is a method from a xmlrpclib.Server instance, func_name == # '__init__' throws xmlrpclib.Fault (see #202) return None