diff options
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git/util.py b/git/util.py index 87ef38d3..a6c5a100 100644 --- a/git/util.py +++ b/git/util.py @@ -574,7 +574,10 @@ class LockFile(object): (self._file_path, lock_file)) try: - fd = os.open(lock_file, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0) + flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL + if is_win: + flags |= getattr(os, 'O_SHORT_LIVED') + fd = os.open(lock_file, flags, 0) os.close(fd) except OSError as e: raise IOError(str(e)) |