Skip to content

Commit 27b78d1

Browse files
authored
fix: HCHarvester JSON results format (#240)
as a dictionary of dictionaries
1 parent 941f8e2 commit 27b78d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

radon/cli/harvest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,12 @@ def _to_dicts(self):
417417
if 'error' in results:
418418
result[filename] = results
419419
else:
420-
result[filename] = results._asdict()
420+
result[filename] = {}
421+
for k, v in results._asdict().items():
422+
if k == "functions":
423+
result[filename]["functions"] = {key: val._asdict() for key, val in v}
424+
else:
425+
result[filename][k] = v._asdict()
421426

422427
return result
423428

0 commit comments

Comments
 (0)