Skip to content

Commit 8a5d87c

Browse files
committed
Refactor format_json.py
1 parent 99d9c0e commit 8a5d87c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

format_json.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
path = Path().resolve()
1010

1111
for file in path.rglob("*.json"):
12-
with codecs.open(str(file), encoding='utf8') as f:
12+
with file.open(encoding='utf8') as f:
1313
data = json.load(f)
1414

15-
with codecs.open(str(file), 'w', encoding='utf8') as f:
16-
print(json.dumps(data, indent=2), file=f)
15+
with file.open('w', encoding='utf8') as f:
16+
print(json.dumps(data, indent=4), file=f)
1717

0 commit comments

Comments
 (0)