diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-22 19:23:21 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-22 19:23:21 +0200 |
commit | 7184340f9d826a52b9e72fce8a30b21a7c73d5be (patch) | |
tree | cabee1826da8d91f8c902a78e179a3170ab7f8ec /lib/git/utils.py | |
parent | 36f838e7977e62284d2928f65cacf29771f1952f (diff) | |
download | gitpython-7184340f9d826a52b9e72fce8a30b21a7c73d5be.tar.gz |
Added test for ConcurrentWriteOperation
Diffstat (limited to 'lib/git/utils.py')
-rw-r--r-- | lib/git/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
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 |