From 73ecb9a9bc8b686010b69deb63b23a8a6981107e 2014-11-13 06:19:08 From: Scott Sanderson Date: 2014-11-13 06:19:08 Subject: [PATCH] MAINT: Remove unncessary try/catch around import_item. This was a relic of an earlier implementation that wasn't using `import_item` directly. --- diff --git a/IPython/utils/traitlets.py b/IPython/utils/traitlets.py index 02bfbfc..98da827 100644 --- a/IPython/utils/traitlets.py +++ b/IPython/utils/traitlets.py @@ -985,13 +985,8 @@ class ForwardDeclaredMixin(object): Find the specified class name by looking for it in the module in which our this_class attribute was defined. """ - try: - modname = self.this_class.__module__ - return import_item('.'.join([modname, string])) - except AttributeError: - raise ImportError( - "Module {} has no attribute {}".format(modname, string) - ) + modname = self.this_class.__module__ + return import_item('.'.join([modname, string])) class ForwardDeclaredType(ForwardDeclaredMixin, Type):