Fix parameter missing in Python 3.7
This commit is contained in:
@@ -201,8 +201,12 @@ class NWDoc:
|
|||||||
docTemp = docPath.with_suffix(".tmp")
|
docTemp = docPath.with_suffix(".tmp")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
docPath.unlink(missing_ok=True)
|
# ToDo: When Python 3.7 is dropped, these can be changed to
|
||||||
docTemp.unlink(missing_ok=True)
|
# path.unlink(missing_ok=True)
|
||||||
|
if docPath.exists():
|
||||||
|
docPath.unlink()
|
||||||
|
if docTemp.exists():
|
||||||
|
docTemp.unlink()
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self._docError = formatException(exc)
|
self._docError = formatException(exc)
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -582,7 +582,8 @@ def testCoreProject_Methods(monkeypatch, mockGUI, fncDir, mockRnd):
|
|||||||
# Write entry
|
# Write entry
|
||||||
statsFile = theProject.storage.getMetaFile(nwFiles.SESS_STATS)
|
statsFile = theProject.storage.getMetaFile(nwFiles.SESS_STATS)
|
||||||
assert isinstance(statsFile, Path)
|
assert isinstance(statsFile, Path)
|
||||||
statsFile.unlink(missing_ok=True)
|
if statsFile.exists():
|
||||||
|
statsFile.unlink()
|
||||||
|
|
||||||
theProject._projOpened = 1600002000
|
theProject._projOpened = 1600002000
|
||||||
theProject.data._initCounts = [50, 50]
|
theProject.data._initCounts = [50, 50]
|
||||||
|
|||||||
Reference in New Issue
Block a user