diff --git a/tools/pz-analyzer/pz_classify.py b/tools/pz-analyzer/pz_classify.py index 7bdb560..d8e17c1 100644 --- a/tools/pz-analyzer/pz_classify.py +++ b/tools/pz-analyzer/pz_classify.py @@ -247,9 +247,9 @@ def _run(input_dir: Path, out_path: Path, *, quiet: bool) -> int: "summary": _build_summary(merged), } - out_path.parent.mkdir(parents=True, exist_ok=True) tmp = out_path.with_suffix(out_path.suffix + ".tmp") try: + out_path.parent.mkdir(parents=True, exist_ok=True) with tmp.open("w", encoding="utf-8") as f: json.dump(document, f, ensure_ascii=False, indent=2) f.write("\n")