From 79d72d935d8eef67ead0b108b9688244dbdab69d 2015-08-28 20:39:29 From: Sylvain Corlay Date: 2015-08-28 20:39:29 Subject: [PATCH] Use isinstance --- diff --git a/IPython/core/magic.py b/IPython/core/magic.py index c44d883..3ac4b1c 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -32,7 +32,7 @@ from IPython.utils.ipstruct import Struct from IPython.utils.process import arg_split from IPython.utils.py3compat import string_types, iteritems from IPython.utils.text import dedent -from traitlets import Bool, Dict, Instance, MetaHasTraits +from traitlets import Bool, Dict, Instance from IPython.utils.warn import error #----------------------------------------------------------------------------- @@ -386,7 +386,7 @@ class MagicsManager(Configurable): if not m.registered: raise ValueError("Class of magics %r was constructed without " "the @register_magics class decorator") - if type(m) in (type, MetaHasTraits): + if isinstance(m, type): # If we're given an uninstantiated class m = m(shell=self.shell)