diff --git a/scripts/wk/debug.py b/scripts/wk/debug.py index 437ab0f8..e0fe75bf 100644 --- a/scripts/wk/debug.py +++ b/scripts/wk/debug.py @@ -20,13 +20,20 @@ METHOD_TYPE = type(DEBUG_CLASS.method) def generate_object_report(obj, indent=0): """Generate debug report for obj, returns list.""" report = [] + attr_list = [] + + # Get attribute list + if hasattr(obj, '__slots__'): + attr_list = list(obj.__slots__) + else: + attr_list = [name for name in dir(obj) if not name.startswith('_')] # Dump object data - for name in dir(obj): + for name in attr_list: attr = getattr(obj, name) - # Skip methods and private attributes - if isinstance(attr, METHOD_TYPE) or name.startswith('_'): + # Skip methods + if isinstance(attr, METHOD_TYPE): continue # Add attribute to report (expanded if necessary)