summaryrefslogtreecommitdiffstats
path: root/module/plugins/Container.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/Container.py')
-rw-r--r--module/plugins/Container.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/module/plugins/Container.py b/module/plugins/Container.py
index 16d0045a6..913c80481 100644
--- a/module/plugins/Container.py
+++ b/module/plugins/Container.py
@@ -44,9 +44,11 @@ class Container(Crypter):
self.pyfile.name = re.findall("([^\/=]+)", self.pyfile.url)[-1]
content = self.load(self.pyfile.url)
self.pyfile.url = save_join(self.config['general']['download_folder'], self.pyfile.name)
- f = open(self.pyfile.url, "wb" )
- f.write(content)
- f.close()
+ try:
+ with open(self.pyfile.url, "wb") as f:
+ f.write(content)
+ except IOError, e:
+ self.fail(str(e))
else:
self.pyfile.name = basename(self.pyfile.url)