Skip to content

Commit

Permalink
break out on failed backup removal
Browse files Browse the repository at this point in the history
  • Loading branch information
emilsvennesson committed Oct 5, 2024
1 parent 4bbbae9 commit d53b923
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/inputstreamhelper/widevine/widevine.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ def remove_old_backups(bpath):
while len(versions) > max_backups + 1:
remove_version = str(versions[1] if versions[0] == parse_version(installed_version) else versions[0])
log(0, 'Removing oldest backup which is not installed: {version}', version=remove_version)
remove_tree(os.path.join(bpath, remove_version))
removed = remove_tree(os.path.join(bpath, remove_version))
if not removed:
log(4, 'Failed to remove {version} backup.', version=remove_version)
break

versions = sorted([parse_version(version) for version in listdir(bpath)])

return

0 comments on commit d53b923

Please sign in to comment.