summaryrefslogtreecommitdiffstats
path: root/pyload/manager/thread/Plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/manager/thread/Plugin.py')
-rw-r--r--pyload/manager/thread/Plugin.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pyload/manager/thread/Plugin.py b/pyload/manager/thread/Plugin.py
index 08a2664da..d8319a2ce 100644
--- a/pyload/manager/thread/Plugin.py
+++ b/pyload/manager/thread/Plugin.py
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
# @author: RaNaN
+from __future__ import with_statement
+
from Queue import Queue
from threading import Thread
from os import listdir, stat
@@ -64,9 +66,8 @@ class PluginThread(Thread):
self.m.log.debug("Error creating zip file: %s" % e)
dump_name = dump_name.replace(".zip", ".txt")
- f = open(dump_name, "wb")
- f.write(dump)
- f.close()
+ with open(dump_name, "wb") as f:
+ f.write(dump)
self.m.core.log.info("Debug Report written to %s" % dump_name)
@@ -128,5 +129,5 @@ class PluginThread(Thread):
def clean(self, pyfile):
""" set thread unactive and release pyfile """
- self.active = True #release pyfile but lets the thread active
+ self.active = True #: release pyfile but lets the thread active
pyfile.release()