Skip to content

Commit 7119be9

Browse files
committed
Ensur output errors are returned
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent f46308f commit 7119be9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/attributecode/model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,13 +1180,12 @@ def write_output(abouts, location, format): # NOQA
11801180
Write a CSV/JSON file at location given a list of About objects.
11811181
Return a list of Error objects.
11821182
"""
1183-
errors = []
11841183
about_dicts = about_object_to_list_of_dictionary(abouts)
11851184
location = add_unc(location)
11861185
if format == 'csv':
1187-
save_as_csv(location, about_dicts, get_field_names(abouts))
1186+
errors = save_as_csv(location, about_dicts, get_field_names(abouts))
11881187
else:
1189-
save_as_json(location, about_dicts)
1188+
errors = save_as_json(location, about_dicts)
11901189
return errors
11911190

11921191

@@ -1197,6 +1196,7 @@ def save_as_json(location, about_dicts):
11971196
with io.open(location, mode=mode) as output_file:
11981197
data = util.format_about_dict_for_json_output(about_dicts)
11991198
output_file.write(json.dumps(data, indent=2))
1199+
return []
12001200

12011201

12021202
def save_as_csv(location, about_dicts, field_names):

0 commit comments

Comments
 (0)