Fix parameter missing in Python 3.7

This commit is contained in:
Veronica Berglyd Olsen committed 2022-11-07 10:45:53 +01:00
1 parent 615ee2958a
commit 6f6fe876e2
2 files changed
+8 -3

No files matched your search

+6 -2
View File
@@ -201,8 +201,12 @@ class NWDoc:
docTemp = docPath.with_suffix(".tmp")
try:
docPath.unlink(missing_ok=True)
docTemp.unlink(missing_ok=True)
# ToDo: When Python 3.7 is dropped, these can be changed to
# path.unlink(missing_ok=True)
if docPath.exists():
docPath.unlink()
if docTemp.exists():
docTemp.unlink()
except Exception as exc:
self._docError = formatException(exc)
return False