diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-11-09 03:08:19 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-09 03:08:19 +0100 |
commit | bd8259220ab4d56ab419b7b32045b08cc9b0a7c8 (patch) | |
tree | 92f1c69d4280f8f57021083dbf878e62033eb502 /module/plugins/crypter/RelinkUs.py | |
parent | Cookie support for getURL method (diff) | |
download | pyload-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.py | 7 |
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 |