File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 11import textwrap
22import re
3- import inspect
43
54from oelint_parser .const_func import KNOWN_FUNCS
65from oelint_parser .const_vars import get_known_machines
@@ -214,11 +213,17 @@ def GetAttributes(self):
214213 Returns:
215214 dict -- all public attributes and their values
216215 """
216+ T = type (self )
217217 res = {}
218- classes = inspect .getmembers (self , inspect .isclass )
219- for cls in classes :
220- for x in inspect .getmembers (cls [1 ], lambda o : isinstance (o , property )):
221- res [x [0 ]] = x [1 ].fget (self )
218+ for _ in dir (self ):
219+ try :
220+ attr = getattr (T , _ )
221+ except AttributeError :
222+ continue # Skip dunder attributes, i.e. private attributes
223+ else :
224+ if isinstance (attr , property ):
225+ res [_ ] = getattr (self , _ )
226+
222227 return res
223228
224229 def __repr__ (self ):
You can’t perform that action at this time.
0 commit comments