aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-08-19 19:47:55 +0100
committerJason R. Coombs <jaraco@jaraco.com>2015-08-19 19:47:55 +0100
commit50aaf9938a4437db7f2949df6ecb6460c789ff28 (patch)
treeb435a989a19cc4e35a5ef531e5eef5f8463aa815 /setuptools/command/easy_install.py
parent3f2ccea66a3deee1e4a4234d695dd94282ec3819 (diff)
downloadexternal_python_setuptools-50aaf9938a4437db7f2949df6ecb6460c789ff28.tar.gz
external_python_setuptools-50aaf9938a4437db7f2949df6ecb6460c789ff28.tar.bz2
external_python_setuptools-50aaf9938a4437db7f2949df6ecb6460c789ff28.zip
Open file in context manager
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 15b260dd..0e912156 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1538,9 +1538,8 @@ class PthDistributions(Environment):
if os.path.islink(self.filename):
os.unlink(self.filename)
- f = open(self.filename, 'wt')
- f.write(data)
- f.close()
+ with open(self.filename, 'wt') as f:
+ f.write(data)
elif os.path.exists(self.filename):
log.debug("Deleting empty %s", self.filename)