From e3c35a8285af3aae5e5a18327c06bba2c7664363 2023-10-17 20:12:05 From: Zoltan Farkas Date: 2023-10-17 20:12:05 Subject: [PATCH] [fix] do not call signature(obj) for non-callables. signature, will check and raise a exception where the message will contain obj.__repr__ and that can be very expensive on certain objects. --- diff --git a/IPython/core/oinspect.py b/IPython/core/oinspect.py index ef6a0d0..82a5666 100644 --- a/IPython/core/oinspect.py +++ b/IPython/core/oinspect.py @@ -416,6 +416,8 @@ class Inspector(Colorable): If any exception is generated, None is returned instead and the exception is suppressed.""" + if not callable(obj): + return None try: return _render_signature(signature(obj), oname) except: