From da3536c40f348431fd9d05beece11a59cda38066 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Jul 2024 21:01:51 +0100 Subject: [PATCH] Less indentation --- posts.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/posts.py b/posts.py index f86d9d1d4..0ad84a77f 100644 --- a/posts.py +++ b/posts.py @@ -1141,14 +1141,15 @@ def _add_schedule_post(base_dir: str, nickname: str, domain: str, except OSError as ex: print('EX: Failed to write entry to scheduled posts index ' + schedule_index_filename + ' ' + str(ex)) - else: - try: - with open(schedule_index_filename, 'w+', - encoding='utf-8') as fp_schedule: - fp_schedule.write(index_str + '\n') - except OSError as ex: - print('EX: Failed to write entry to scheduled posts index2 ' + - schedule_index_filename + ' ' + str(ex)) + return + + try: + with open(schedule_index_filename, 'w+', + encoding='utf-8') as fp_schedule: + fp_schedule.write(index_str + '\n') + except OSError as ex: + print('EX: Failed to write entry to scheduled posts index2 ' + + schedule_index_filename + ' ' + str(ex)) def _create_post_cw_from_reply(base_dir: str, nickname: str, domain: str,