From 53357077986f061b6a1fbe2a15cde14c4da6dae8 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 18 Mar 2012 23:58:19 -0400 Subject: Make tests run on PyPy, and make test_farm more comprehensible. --- coverage/html.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'coverage/html.py') diff --git a/coverage/html.py b/coverage/html.py index 4814c94..00b9258 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: -- cgit v1.2.1