From 575b670fe571cf2a3ca823688bcbcfce99bf97ba 2013-10-29 16:15:55 From: Thomas Kluyver Date: 2013-10-29 16:15:55 Subject: [PATCH] Fix references to deprecated objects in the types module 2to3 fixer: types --- diff --git a/IPython/utils/jsonutil.py b/IPython/utils/jsonutil.py index 842ebe2..6d8aceb 100644 --- a/IPython/utils/jsonutil.py +++ b/IPython/utils/jsonutil.py @@ -184,7 +184,7 @@ def json_clean(obj): """ # types that are 'atomic' and ok in json as-is. bool doesn't need to be # listed explicitly because bools pass as int instances - atomic_ok = (unicode_type, int, types.NoneType) + atomic_ok = (unicode_type, int, type(None)) # containers that we need to convert into lists container_to_list = (tuple, set, types.GeneratorType) diff --git a/IPython/utils/wildcard.py b/IPython/utils/wildcard.py index 2037a0c..d22491b 100644 --- a/IPython/utils/wildcard.py +++ b/IPython/utils/wildcard.py @@ -44,7 +44,7 @@ def is_type(obj, typestr_or_type): TODO: Should be extended for choosing more than one type.""" if typestr_or_type == "all": return True - if type(typestr_or_type) == types.TypeType: + if type(typestr_or_type) == type: test_type = typestr_or_type else: test_type = typestr2type.get(typestr_or_type, False)