diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-01 18:20:13 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-01 18:25:57 +0200 |
commit | 9a521681ff8614beb8e2c566cf3c475baca22169 (patch) | |
tree | 77365cb808a255eb53889725bfce775b5090330e /git/remote.py | |
parent | bdf1e68f6bec679edc3feb455596e18c387879c4 (diff) | |
download | gitpython-9a521681ff8614beb8e2c566cf3c475baca22169.tar.gz |
io, #519: ALL open() --> with open()
+ Some cases had restructuring of code.
Diffstat (limited to 'git/remote.py')
-rw-r--r-- | git/remote.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/git/remote.py b/git/remote.py index 58238991..c2ffcc1a 100644 --- a/git/remote.py +++ b/git/remote.py @@ -638,9 +638,8 @@ class Remote(LazyMixin, Iterable): finalize_process(proc, stderr=stderr_text) # read head information - fp = open(join(self.repo.git_dir, 'FETCH_HEAD'), 'rb') - fetch_head_info = [l.decode(defenc) for l in fp.readlines()] - fp.close() + with open(join(self.repo.git_dir, 'FETCH_HEAD'), 'rb') as fp: + fetch_head_info = [l.decode(defenc) for l in fp.readlines()] l_fil = len(fetch_info_lines) l_fhi = len(fetch_head_info) |