Skip to content

Commit ee2b2f1

Browse files
committed
handle missing file
1 parent 3c7946e commit ee2b2f1

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

bin/json_helpers.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,9 @@ def load_json(
1818
) -> tuple[Dict[str, Any]]:
1919
"""Load issues from JSON file and return issues + timestamp."""
2020
if not os.path.exists(filename):
21-
return {}
21+
return None
2222

2323
with open(filename, "r", encoding="utf-8") as f:
2424
data = json.load(f)
2525

2626
return data
27-
28-
# Handle old format (just a list) vs new format (dict with metadata)
29-
if isinstance(data, list):
30-
issues = data
31-
timestamp = "Unknown (old format)"
32-
else:
33-
issues = data.get("issues", [])
34-
timestamp = data.get("fetch_timestamp_human", "Unknown")
35-
36-
print(f"Loaded {len(issues)} issues from {filename} (last fetched: {timestamp})")

0 commit comments

Comments
 (0)