File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1228,13 +1228,16 @@ def enter_api_key_and_save_to_rc() -> None:
12281228
12291229
12301230def create_find_common_tags_file (args : Namespace , file_name : str ) -> Path :
1231- find_common_tags_content = """def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]:
1231+ find_common_tags_content = """from __future__ import annotations
1232+
1233+
1234+ def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]:
12321235 if not articles:
12331236 return set()
12341237
1235- common_tags = articles[0][ "tags"]
1238+ common_tags = articles[0].get( "tags", [])
12361239 for article in articles[1:]:
1237- common_tags = [tag for tag in common_tags if tag in article[ "tags"] ]
1240+ common_tags = [tag for tag in common_tags if tag in article.get( "tags", []) ]
12381241 return set(common_tags)
12391242"""
12401243
You can’t perform that action at this time.
0 commit comments