From 9bcecc2dc56d7a3c9b6f51239f9d5d01f14ca7a0 2017-05-24 18:17:20 From: Matthias Bussonnier Date: 2017-05-24 18:17:20 Subject: [PATCH] remove py2 code --- diff --git a/IPython/lib/pretty.py b/IPython/lib/pretty.py index c556684..4a153bd 100644 --- a/IPython/lib/pretty.py +++ b/IPython/lib/pretty.py @@ -484,11 +484,6 @@ class GroupQueue(object): except ValueError: pass -try: - _baseclass_reprs = (object.__repr__, types.InstanceType.__repr__) -except AttributeError: # Python 3 - _baseclass_reprs = (object.__repr__,) - def _default_pprint(obj, p, cycle): """ @@ -496,7 +491,7 @@ def _default_pprint(obj, p, cycle): it's none of the builtin objects. """ klass = _safe_getattr(obj, '__class__', None) or type(obj) - if _safe_getattr(klass, '__repr__', None) not in _baseclass_reprs: + if _safe_getattr(klass, '__repr__', None) is not object.__repr__: # A user-provided repr. Find newlines and replace them with p.break_() _repr_pprint(obj, p, cycle) return