From d34a2059df6e1a9b4265e655cd61bc2077c3c5a0 Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Wed, 8 Jan 2025 05:09:36 -0800 Subject: [PATCH] Fixed PLW0120 (useless-else-on-loop): `else` clause on loop without a `break` statement; remove the `else` and dedent its contents --- management/backup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/management/backup.py b/management/backup.py index 8a92cc78..6ec7e3af 100755 --- a/management/backup.py +++ b/management/backup.py @@ -178,10 +178,9 @@ def should_force_full(config, env): if dateutil.parser.parse(bak["date"]) + datetime.timedelta(days=config["min_age_in_days"]*10+1) < datetime.datetime.now(dateutil.tz.tzlocal()): return True return False - else: - # If we got here there are no (full) backups, so make one. - # (I love for/else blocks. Here it's just to show off.) - return True + # If we got here there are no (full) backups, so make one. + # (I love for/else blocks. Here it's just to show off.) + return True def get_passphrase(env): # Get the encryption passphrase. secret_key.txt is 2048 random