aboutsummaryrefslogtreecommitdiffstats
path: root/distribute_setup.py
diff options
context:
space:
mode:
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):