aboutsummaryrefslogtreecommitdiffstats
path: root/distribute_setup.py
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com>2012-12-29 06:23:09 +0100
committerArfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com>2012-12-29 06:23:09 +0100
commit721559fe76a1cda3de639ee2aaa446595169d26b (patch)
treea33afb83c609e4124c7f78fa79ded12f9f139f8a /distribute_setup.py
parent5f6ebc0579291a7dd316e2a64466e688ef7bdb69 (diff)
downloadexternal_python_setuptools-721559fe76a1cda3de639ee2aaa446595169d26b.tar.gz
external_python_setuptools-721559fe76a1cda3de639ee2aaa446595169d26b.tar.bz2
external_python_setuptools-721559fe76a1cda3de639ee2aaa446595169d26b.zip
Fix some ResourceWarnings.
--HG-- branch : distribute extra : rebase_source : 31ac3f0135d8cfe0fabc274f1649d1c99eba2868
Diffstat (limited to 'distribute_setup.py')
-rw-r--r--distribute_setup.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/distribute_setup.py b/distribute_setup.py
index f7954e84..23503c64 100644
--- a/distribute_setup.py
+++ b/distribute_setup.py
@@ -239,7 +239,9 @@ def _no_sandbox(function):
def _patch_file(path, content):
"""Will backup the file then patch it"""
- existing_content = open(path).read()
+ f = open(path)
+ existing_content = f.read()
+ f.close()
if existing_content == content:
# already patched
log.warn('Already patched.')
@@ -257,7 +259,10 @@ _patch_file = _no_sandbox(_patch_file)
def _same_content(path, content):
- return open(path).read() == content
+ f = open(path)
+ existing_content = f.read()
+ f.close()
+ return existing_content == content
def _rename_path(path):