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 @@ -1276,13 +1276,16 @@ def enter_api_key_and_save_to_rc() -> None:
12761276
12771277
12781278def create_find_common_tags_file (args : Namespace , file_name : str ) -> Path :
1279- find_common_tags_content = """def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]:
1279+ find_common_tags_content = """from __future__ import annotations
1280+
1281+
1282+ def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]:
12801283 if not articles:
12811284 return set()
12821285
1283- common_tags = articles[0][ "tags"]
1286+ common_tags = articles[0].get( "tags", [])
12841287 for article in articles[1:]:
1285- common_tags = [tag for tag in common_tags if tag in article[ "tags"] ]
1288+ common_tags = [tag for tag in common_tags if tag in article.get( "tags", []) ]
12861289 return set(common_tags)
12871290"""
12881291
You can’t perform that action at this time.
0 commit comments