diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-08-26 12:53:55 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-08-26 12:53:55 -0700 |
commit | 42c96587b86ba8f551f605086e47a5cd96843a1a (patch) | |
tree | 92c843f2d647fa5976b0115e3581fdebb3dbae4d /pym/portage/xpak.py | |
parent | Update --rebuild-if-* flags to rebuild when build dependencies are changed. (diff) | |
download | portage-42c96587b86ba8f551f605086e47a5cd96843a1a.tar.gz portage-42c96587b86ba8f551f605086e47a5cd96843a1a.tar.bz2 portage-42c96587b86ba8f551f605086e47a5cd96843a1a.zip |
python3.2 fixes: ResourceWarning: unclosed file
Diffstat (limited to 'pym/portage/xpak.py')
-rw-r--r-- | pym/portage/xpak.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/portage/xpak.py b/pym/portage/xpak.py index 01cfe7b0a..a05a86009 100644 --- a/pym/portage/xpak.py +++ b/pym/portage/xpak.py @@ -99,7 +99,8 @@ def xpak(rootdir,outfile=None): # CONTENTS is generated during the merge process. continue x = _unicode_encode(x, encoding=_encodings['fs'], errors='strict') - mydata[x] = open(os.path.join(rootdir, x), 'rb').read() + with open(os.path.join(rootdir, x), 'rb') as f: + mydata[x] = f.read() xpak_segment = xpak_mem(mydata) if outfile: |