summaryrefslogtreecommitdiffstats
path: root/pym/portage/update.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/update.py')
-rw-r--r--pym/portage/update.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pym/portage/update.py b/pym/portage/update.py
index 52ab50645..548d19cef 100644
--- a/pym/portage/update.py
+++ b/pym/portage/update.py
@@ -132,10 +132,11 @@ def grab_updates(updpath, prev_mtimes=None):
if update_data or \
file_path not in prev_mtimes or \
long(prev_mtimes[file_path]) != mystat[stat.ST_MTIME]:
- content = io.open(_unicode_encode(file_path,
+ f = io.open(_unicode_encode(file_path,
encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['repo.content'], errors='replace'
- ).read()
+ mode='r', encoding=_encodings['repo.content'], errors='replace')
+ content = f.read()
+ f.close()
update_data.append((file_path, mystat, content))
return update_data