mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 11:26:39 +00:00
[core] Enable ruff PTH (flake8-use-pathlib) lint family (#16661)
This commit is contained in:
@@ -91,7 +91,7 @@ def load_analysis_json(json_path: str) -> dict | None:
|
||||
return None
|
||||
|
||||
try:
|
||||
with open(json_file, encoding="utf-8") as f:
|
||||
with Path(json_file).open(encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
except (json.JSONDecodeError, OSError) as e:
|
||||
print(f"Failed to load analysis JSON: {e}", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user