From 7184340f9d826a52b9e72fce8a30b21a7c73d5be Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 22 Oct 2009 19:23:21 +0200 Subject: Added test for ConcurrentWriteOperation --- lib/git/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/git/utils.py') diff --git a/lib/git/utils.py b/lib/git/utils.py index dd1117b6..f188a7a4 100644 --- a/lib/git/utils.py +++ b/lib/git/utils.py @@ -205,7 +205,10 @@ class ConcurrentWriteOperation(LockFile): if successful: # on windows, rename does not silently overwrite the existing one if sys.platform == "win32": - os.remove(self._file_path) + if os.path.isfile(self._file_path): + os.remove(self._file_path) + # END remove if exists + # END win32 special handling os.rename(self._temp_write_fp.name, self._file_path) else: # just delete the file so far, we failed -- cgit v1.2.1