Skip to content

Commit e5aecf2

Browse files
fix: replace bare except clauses with except Exception in inspection.py
1 parent 4a636cf commit e5aecf2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bpython/inspection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def getfuncprops(func: str, f: Callable) -> FuncProps | None:
269269
# not take 'self', the latter would:
270270
try:
271271
func_name = getattr(f, "__name__", None)
272-
except:
272+
except Exception:
273273
# if calling foo.__name__ would result in an error
274274
func_name = None
275275

@@ -279,7 +279,7 @@ def getfuncprops(func: str, f: Callable) -> FuncProps | None:
279279
or (func_name == "__init__" and not func.endswith(".__init__"))
280280
or (func_name == "__new__" and not func.endswith(".__new__"))
281281
)
282-
except:
282+
except Exception:
283283
# if f is a method from a xmlrpclib.Server instance, func_name ==
284284
# '__init__' throws xmlrpclib.Fault (see #202)
285285
return None

0 commit comments

Comments
 (0)