Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ac9be5

Browse files
committed
Merge pull request ipython#8778 from SylvainCorlay/Meta
Use isinstance to check for types
2 parents 4b3b276 + 79d72d9 commit 3ac9be5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

IPython/core/magic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from IPython.utils.process import arg_split
3333
from IPython.utils.py3compat import string_types, iteritems
3434
from IPython.utils.text import dedent
35-
from traitlets import Bool, Dict, Instance, MetaHasTraits
35+
from traitlets import Bool, Dict, Instance
3636
from IPython.utils.warn import error
3737

3838
#-----------------------------------------------------------------------------
@@ -386,7 +386,7 @@ def register(self, *magic_objects):
386386
if not m.registered:
387387
raise ValueError("Class of magics %r was constructed without "
388388
"the @register_magics class decorator")
389-
if type(m) in (type, MetaHasTraits):
389+
if isinstance(m, type):
390390
# If we're given an uninstantiated class
391391
m = m(shell=self.shell)
392392

0 commit comments

Comments
 (0)