diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2014-03-30 13:59:13 +0100 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-03-30 13:59:13 +0100 |
| commit | 86cd51682907df59a05918584bb85663862adeac (patch) | |
| tree | 75b52991e1823628213a5ee2d4de3a1e6f79fcb5 /setuptools/command/bdist_egg.py | |
| parent | c410f8d4eaaba5575453fbee26948419bbc2a247 (diff) | |
| download | python-setuptools-git-86cd51682907df59a05918584bb85663862adeac.tar.gz | |
Use file context for write_stub
Diffstat (limited to 'setuptools/command/bdist_egg.py')
| -rw-r--r-- | setuptools/command/bdist_egg.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 0d1cc65e..c19a0ba7 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -44,9 +44,8 @@ def write_stub(resource, pyfile): imp.load_dynamic(__name__,__file__) __bootstrap__() """).lstrip() - f = open(pyfile,'w') - f.write(_stub_template % resource) - f.close() + with open(pyfile, 'w') as f: + f.write(_stub_template % resource) class bdist_egg(Command): |
