From f917c7fd36a744744880854608a5ed717fa755a0 Mon Sep 17 00:00:00 2001 From: mkaay Date: Fri, 13 Nov 2009 22:15:48 +0100 Subject: python25 compatibility --- module/plugins/RapidshareCom.py | 5 +++-- module/plugins/UploadedTo.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 73424696e..7706a7cf7 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -203,8 +203,9 @@ class RapidshareCom(Plugin): def check_file(self, local_file): if self.api_data and self.api_data["checksum"]: h = hashlib.md5() - with open(local_file, "rb") as f: - h.update(f.read()) + f = open(local_file, "rb"): + h.update(f.read()) + f.close() hexd = h.hexdigest() if hexd == self.api_data["checksum"]: return (True, 0) diff --git a/module/plugins/UploadedTo.py b/module/plugins/UploadedTo.py index 9ae008480..bda0bf899 100644 --- a/module/plugins/UploadedTo.py +++ b/module/plugins/UploadedTo.py @@ -145,8 +145,9 @@ class UploadedTo(Plugin): def check_file(self, local_file): if self.api_data and self.api_data["checksum"]: h = hashlib.sha1() - with open(local_file, "rb") as f: - h.update(f.read()) + f = open(local_file, "rb"): + h.update(f.read()) + f.close() hexd = h.hexdigest() if hexd == self.api_data["checksum"]: return (True, 0) -- cgit v1.2.3