From d360331af4ea1f635505b510e62d194039297812 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Sat, 27 Mar 2021 18:34:20 +0800 Subject: [PATCH] remove := syntax --- recipes/economist.recipe | 5 +++-- recipes/economist_free.recipe | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/recipes/economist.recipe b/recipes/economist.recipe index 90901c1b28..e5f7628be9 100644 --- a/recipes/economist.recipe +++ b/recipes/economist.recipe @@ -264,8 +264,9 @@ class Economist(BasicNewsRecipe): return ans def economist_parse_index(self, soup): - if (tag := soup.select_one("script#__NEXT_DATA__")) is not None: - data = json.loads(tag.string) + script_tag = soup.select_one("script#__NEXT_DATA__") + if script_tag is not None: + data = json.loads(script_tag.string) self.cover_url = data['props']['pageProps']['content']['image']['main']['url']['canonical'] self.log('Got cover:', self.cover_url) feeds = [] diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe index 90901c1b28..e5f7628be9 100644 --- a/recipes/economist_free.recipe +++ b/recipes/economist_free.recipe @@ -264,8 +264,9 @@ class Economist(BasicNewsRecipe): return ans def economist_parse_index(self, soup): - if (tag := soup.select_one("script#__NEXT_DATA__")) is not None: - data = json.loads(tag.string) + script_tag = soup.select_one("script#__NEXT_DATA__") + if script_tag is not None: + data = json.loads(script_tag.string) self.cover_url = data['props']['pageProps']['content']['image']['main']['url']['canonical'] self.log('Got cover:', self.cover_url) feeds = []