Commit 32225a8a authored by Guido Stevens's avatar Guido Stevens Committed by GitHub

properly close resources

Fixes ``buildout.py:574: ResourceWarning: unclosed file <_io.TextIOWrapper...>```
parent 97003f82
......@@ -571,7 +571,8 @@ class Buildout(DictMixin):
if dist.precedence == pkg_resources.DEVELOP_DIST:
dest = os.path.join(self['buildout']['develop-eggs-directory'],
dist.key + '.egg-link')
open(dest, 'w').write(dist.location)
with open(dest, 'w') as fh:
fh.write(dist.location)
entries.append(dist.location)
else:
dest = os.path.join(self['buildout']['eggs-directory'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment