summaryrefslogtreecommitdiff
path: root/setuptools/command/develop.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-12-11 10:04:44 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-12-11 10:04:44 -0500
commit76ffa368456be9ecbcb81a8ba3196f1246e444c0 (patch)
tree60b7b3e28d517cff16ec2a1a2e6be40cc0d60c80 /setuptools/command/develop.py
parent81ca4fea9e4672f39864439f2049108ad731c8fa (diff)
downloadpython-setuptools-git-76ffa368456be9ecbcb81a8ba3196f1246e444c0.tar.gz
Use context manager for opening file
Diffstat (limited to 'setuptools/command/develop.py')
-rwxr-xr-xsetuptools/command/develop.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py
index 3a16cdc7..85118767 100755
--- a/setuptools/command/develop.py
+++ b/setuptools/command/develop.py
@@ -125,9 +125,8 @@ class develop(easy_install):
# create an .egg-link in the installation dir, pointing to our egg
log.info("Creating %s (link to %s)", self.egg_link, self.egg_base)
if not self.dry_run:
- f = open(self.egg_link, "w")
- f.write(self.egg_path + "\n" + self.setup_path)
- f.close()
+ with open(self.egg_link, "w") as f:
+ f.write(self.egg_path + "\n" + self.setup_path)
# postprocess the installed distro, fixing up .pth, installing scripts,
# and handling requirements
self.process_distribution(None, self.dist, not self.no_deps)