From 12056b55c2c263dca0d6a1184fda3fe5b598479e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 19 Jul 2024 11:59:57 +0100 Subject: [PATCH] Less indentation --- schedule.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/schedule.py b/schedule.py index 610eeb894..f757d96c2 100644 --- a/schedule.py +++ b/schedule.py @@ -267,9 +267,10 @@ def remove_scheduled_posts(base_dir: str, nickname: str, domain: str) -> None: return for scheduled_post_filename in os.listdir(scheduled_dir): file_path = os.path.join(scheduled_dir, scheduled_post_filename) - if os.path.isfile(file_path): - try: - os.remove(file_path) - except OSError: - print('EX: remove_scheduled_posts unable to delete ' + - file_path) + if not os.path.isfile(file_path): + continue + try: + os.remove(file_path) + except OSError: + print('EX: remove_scheduled_posts unable to delete ' + + file_path)