Commit a2e7efa1 authored by Michael Büsch's avatar Michael Büsch

util: Add exception handler to unlink call

Signed-off-by: Michael Büsch's avatarMichael Buesch <>
parent a4dbd87b
......@@ -201,7 +201,7 @@ def safeFileWrite(filename, data):
if not osIsPosix: #@nocov
# Can't use safe rename on non-POSIX.
# Must unlink first.
with contextlib.suppress(OSError):
with contextlib.suppress(IOError, OSError):
os.rename(tmpFile, filename)
except (IOError, OSError) as e: #@nocov
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment