diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-01 12:58:54 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-01 13:02:53 +0200 |
commit | a79cf677744e2c1721fa55f934fa07034bc54b0a (patch) | |
tree | ac4bc1ae7d58cab6735633a66dc9b4fb437a8cea /git/repo/fun.py | |
parent | 13d399f4460ecb17cecc59d7158a4159010b2ac5 (diff) | |
download | gitpython-a79cf677744e2c1721fa55f934fa07034bc54b0a.tar.gz |
repo-TCs, #519: FIX config resource leaks
+ Modify lock/read-config-file code to ensure files closed.
+ Use `with GitConfigarser()` more systematically in TCs.
+ Clear any locks left hanging from prev Tcs.
+ Util: mark lock-files as SHORT_LIVED; save some SSDs...
Diffstat (limited to 'git/repo/fun.py')
-rw-r--r-- | git/repo/fun.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/git/repo/fun.py b/git/repo/fun.py index 6b06663a..0483eaa9 100644 --- a/git/repo/fun.py +++ b/git/repo/fun.py @@ -25,8 +25,8 @@ __all__ = ('rev_parse', 'is_git_dir', 'touch', 'find_git_dir', 'name_to_object', def touch(filename): - fp = open(filename, "ab") - fp.close() + with open(filename, "ab"): + pass return filename |