diff --git a/IPython/core/oinspect.py b/IPython/core/oinspect.py index 5bcb2bf..48631f3 100644 --- a/IPython/core/oinspect.py +++ b/IPython/core/oinspect.py @@ -662,10 +662,8 @@ class Inspector: # from its __call__ method. if inspect.isclass(obj): - try: - callable_obj = obj.__init__ - except AttributeError: - callable_obj = None + # Old-style classes need not have an __init__ + callable_obj = getattr(obj, "__init__", None) elif callable(obj): callable_obj = obj else: