summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/RelinkUs.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-09 03:08:19 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-09 03:08:19 +0100
commitbd8259220ab4d56ab419b7b32045b08cc9b0a7c8 (patch)
tree92f1c69d4280f8f57021083dbf878e62033eb502 /module/plugins/crypter/RelinkUs.py
parentCookie support for getURL method (diff)
downloadpyload-bd8259220ab4d56ab419b7b32045b08cc9b0a7c8.tar.xz
Use with statement instead open method when accessing fod + handle i/o error
Diffstat (limited to 'module/plugins/crypter/RelinkUs.py')
-rw-r--r--module/plugins/crypter/RelinkUs.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index cdb699ae0..4c84b62f7 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -216,12 +216,11 @@ class RelinkUs(Crypter):
dlc = self.load(container_url)
dlc_filename = self.fileid + ".dlc"
dlc_filepath = os.path.join(self.config['general']['download_folder'], dlc_filename)
- f = open(dlc_filepath, "wb")
- f.write(dlc)
- f.close()
+ with open(dlc_filepath, "wb") as f:
+ f.write(dlc)
package_links.append(dlc_filepath)
except:
- self.logDebug("Unable to download DLC container")
+ self.fail("Unable to download DLC container")
return package_links