summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/PremiumTo.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/PremiumTo.py')
-rw-r--r--module/plugins/hoster/PremiumTo.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py
index 183182689..beab4391e 100644
--- a/module/plugins/hoster/PremiumTo.py
+++ b/module/plugins/hoster/PremiumTo.py
@@ -54,9 +54,8 @@ class PremiumTo(Hoster):
lastDownload = fs_encode(self.lastDownload)
if exists(lastDownload):
- f = open(lastDownload, "rb")
- err = f.read(256).strip()
- f.close()
+ with open(lastDownload, "rb") as f:
+ err = f.read(256).strip()
remove(lastDownload)
else:
err = _('File does not exist')