summaryrefslogtreecommitdiff
path: root/coverage/html.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/html.py')
-rw-r--r--coverage/html.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/coverage/html.py b/coverage/html.py
index 4814c943..00b92587 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -246,7 +246,11 @@ class HtmlStatus(object):
usable = False
try:
status_file = os.path.join(directory, self.STATUS_FILE)
- status = pickle.load(open(status_file, "rb"))
+ fstatus = open(status_file, "rb")
+ try:
+ status = pickle.load(fstatus)
+ finally:
+ fstatus.close()
except IOError:
usable = False
else: