From ff63cbb75e26dfc9d4b4f88b6dbf596e3bdcc322 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 5 Nov 2023 08:21:23 +0530 Subject: [PATCH] Cleanup previous PR We cant use walrus operator in recipes as they can potentially run on very old versions of python. --- recipes/epoch_times.recipe | 2 +- recipes/phillosophy_now.recipe | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/epoch_times.recipe b/recipes/epoch_times.recipe index d453ff5ba8..cf2c0cc8b8 100644 --- a/recipes/epoch_times.recipe +++ b/recipes/epoch_times.recipe @@ -24,7 +24,7 @@ class EpochTimes(BasicNewsRecipe): ] remove_tags = [ classes('print:hidden h-header shortcode aspect-square'), - dict(name='button', 'svg'), + dict(name=['button', 'svg']), dict(name='img', attrs={'src':lambda x: x and x.endswith('svg')}) ] diff --git a/recipes/phillosophy_now.recipe b/recipes/phillosophy_now.recipe index 486550c774..1fb4810ddc 100644 --- a/recipes/phillosophy_now.recipe +++ b/recipes/phillosophy_now.recipe @@ -35,7 +35,8 @@ class PhilosophyNow(BasicNewsRecipe): soup = self.index_to_soup('https://philosophynow.org/') div = soup.find('div', attrs={'id': 'aside_issue_cover'}) url = div.find('a', href=True)['href'] - if issue := div.find('div', attrs={'id':'aside_issue_text'}): + issue = div.find('div', attrs={'id':'aside_issue_text'}) + if issue: self.log('Downloading issue:', self.tag_to_string(issue).strip()) self.timefmt = ' [' + self.tag_to_string(issue.find(attrs={'id':'aside_issue_date'})) + ']' self.title = 'Philosophy Now ' + self.tag_to_string(issue.find(attrs={'id':'aside_issue_number'}))