@@ -72,20 +72,19 @@ def __enter__(self):
7272 # original methods. :-(
7373 # The upshot being that introspecting on an object to display its
7474 # attributes will avoid unwanted side-effects.
75- if is_new_style (self .obj ):
76- __getattr__ = getattr (type_ , "__getattr__" , None )
77- if __getattr__ is not None :
78- try :
79- setattr (type_ , "__getattr__" , (lambda * _ , ** __ : None ))
80- except TypeError :
81- __getattr__ = None
82- __getattribute__ = getattr (type_ , "__getattribute__" , None )
83- if __getattribute__ is not None :
84- try :
85- setattr (type_ , "__getattribute__" , object .__getattribute__ )
86- except TypeError :
87- # XXX: This happens for e.g. built-in types
88- __getattribute__ = None
75+ __getattr__ = getattr (type_ , "__getattr__" , None )
76+ if __getattr__ is not None :
77+ try :
78+ setattr (type_ , "__getattr__" , (lambda * _ , ** __ : None ))
79+ except TypeError :
80+ __getattr__ = None
81+ __getattribute__ = getattr (type_ , "__getattribute__" , None )
82+ if __getattribute__ is not None :
83+ try :
84+ setattr (type_ , "__getattribute__" , object .__getattribute__ )
85+ except TypeError :
86+ # XXX: This happens for e.g. built-in types
87+ __getattribute__ = None
8988 self .attribs = (__getattribute__ , __getattr__ )
9089 # /Dark magic
9190
@@ -101,10 +100,6 @@ def __exit__(self, exc_type, exc_val, exc_tb):
101100 # /Dark magic
102101
103102
104- def is_new_style (obj ):
105- return True
106-
107-
108103class _Repr (object ):
109104 """
110105 Helper for `fixlongargs()`: Returns the given value in `__repr__()`.
0 commit comments