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 | 6e4afcdef296e135cdff058dc77eabb35ba9ccb8 (patch) | |
| tree | 1fd13029830059f2c4e2e63bc6caf690e42449ae /setuptools/command | |
| parent | 3347afaa80bb2c3df458cd9c03443a1d5b1bbc31 (diff) | |
| download | python-setuptools-bitbucket-6e4afcdef296e135cdff058dc77eabb35ba9ccb8.tar.gz | |
Use file context for write_stub
Diffstat (limited to 'setuptools/command')
| -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): |
