From 7a484975e2e496fc221c87191a7c8ce53b3e001e Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 16 Apr 2023 21:28:32 +0100 Subject: [PATCH] Fix, only parse valid JSON files --- lib/combine.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/combine.py b/lib/combine.py index 1cca9e6..d9697ad 100644 --- a/lib/combine.py +++ b/lib/combine.py @@ -15,10 +15,11 @@ templates = [] for file in files: # Open the file with open(templates_src_dir + file) as f: - # Load the JSON into a variable - data = json.load(f)['templates'] - # Append the template object to the templates list - templates = templates + data + if file.endswith('.json'): + # Load the JSON into a variable + data = json.load(f)['templates'] + # Append the template object to the templates list + templates = templates + data # Remove duplicates seen_titles = set()