Skip to content

Commit 5a6cb97

Browse files
authored
Fix MSIXData _asdict AttributeError by using dataclasses.asdict (#459)
Replaces the incorrect _asdict() method call on MSIXData dataclass with the proper dataclasses.asdict() function. MSIXData is a dataclass (not a namedtuple), so it doesn't have the _asdict() method that namedtuples provide. Fixes #458 - resolves "'MSIXData' object has no attribute '_asdict'" error
1 parent c2e762e commit 5a6cb97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cli/host_device_collector.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import json
1010
import logging
1111
import time
12+
from dataclasses import asdict
1213

1314
from pathlib import Path
1415
from typing import Dict, Any, Optional
@@ -111,7 +112,7 @@ def collect_device_context(self, output_dir: Path) -> Dict[str, Any]:
111112
"config_space_hex": config_space_bytes.hex(),
112113
"device_info": device_info,
113114
"msix_data": (
114-
msix_data._asdict() if msix_data.preloaded else None
115+
asdict(msix_data) if msix_data.preloaded else None
115116
),
116117
"collection_metadata": {
117118
"collected_at": time.time(),
@@ -237,4 +238,4 @@ def _save_collected_data(self, output_dir: Path, data: Dict[str, Any]) -> None:
237238
context_file=context_file
238239
),
239240
prefix="HOST"
240-
)
241+
)

0 commit comments

Comments
 (0)