Skip to content

Commit 4714740

Browse files
authored
Merge pull request #1639 from skshetry/close-lockfile
util: close lockfile after opening successfully
2 parents f882cd8 + 3e829eb commit 4714740

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git/util.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,8 @@ def _obtain_lock_or_raise(self) -> None:
935935
)
936936

937937
try:
938-
open(lock_file, mode='w', closefd=True)
938+
with open(lock_file, mode='w'):
939+
pass
939940
except OSError as e:
940941
raise IOError(str(e)) from e
941942

0 commit comments

Comments
 (0)