summaryrefslogtreecommitdiffstats
path: root/module/plugins/container/CCF.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-09 16:58:35 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-09 16:58:35 +0100
commit4d578cb15f3d6edd036e438e504739b97660f93e (patch)
treeea8fd0a2a62466204feebb046525226f4297c962 /module/plugins/container/CCF.py
parentFix __version__ format in some plugins (diff)
downloadpyload-4d578cb15f3d6edd036e438e504739b97660f93e.tar.xz
Spare code cosmetics
Diffstat (limited to 'module/plugins/container/CCF.py')
-rw-r--r--module/plugins/container/CCF.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py
index ff7d43e08..bca535175 100644
--- a/module/plugins/container/CCF.py
+++ b/module/plugins/container/CCF.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
+from __future__ import with_statement
+
import re
from os import makedirs
@@ -35,8 +37,7 @@ class CCF(Container):
download_folder = self.config['general']['download_folder']
tempdlc_name = save_join(download_folder, "tmp_%s.dlc" % pyfile.name)
- tempdlc = open(tempdlc_name, "w")
- tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.S).group(1))
- tempdlc.close()
+ with open(tempdlc_name, "w") as tempdlc:
+ tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.S).group(1))
self.urls = [tempdlc_name]