From 76ffa368456be9ecbcb81a8ba3196f1246e444c0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 11 Dec 2015 10:04:44 -0500 Subject: Use context manager for opening file --- setuptools/command/develop.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'setuptools/command/develop.py') 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) -- cgit v1.2.3