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 @@ -1227,13 +1227,16 @@ def enter_api_key_and_save_to_rc() -> None:
12271227
12281228
12291229def create_find_common_tags_file (args : Namespace , file_name : str ) -> Path :
1230- find_common_tags_content = """def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]:
1230+ find_common_tags_content = """from __future__ import annotations
1231+
1232+
1233+ def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]:
12311234 if not articles:
12321235 return set()
12331236
1234- common_tags = articles[0][ "tags"]
1237+ common_tags = articles[0].get( "tags", [])
12351238 for article in articles[1:]:
1236- common_tags = [tag for tag in common_tags if tag in article[ "tags"] ]
1239+ common_tags = [tag for tag in common_tags if tag in article.get( "tags", []) ]
12371240 return set(common_tags)
12381241"""
12391242
You can’t perform that action at this time.
0 commit comments