refactor: suppress OSError when unlinking temporary files in ArtResizer

This commit is contained in:
Dr.Blank 2026-01-16 15:43:01 +05:30
parent 9972041e4b
commit e85f67ac7b
No known key found for this signature in database
GPG key ID: BA5F87FF0560C57B

View file

@ -21,6 +21,7 @@ import os.path
import platform
import re
import subprocess
from contextlib import suppress
from itertools import chain
from urllib.parse import urlencode
@ -660,10 +661,8 @@ class ArtResizer(metaclass=Shareable):
)
finally:
if result_path != path_in:
try:
with suppress(OSError):
os.unlink(path_in)
except OSError:
pass
return result_path
@property