summaryrefslogtreecommitdiffstats
path: root/pyload/manager/thread/Plugin.py
diff options
context:
space:
mode:
authorGravatar ardi69 <armin@diedering.de> 2015-04-21 06:51:24 +0200
committerGravatar ardi69 <armin@diedering.de> 2015-04-21 06:51:24 +0200
commit2f8433b6a10505d29a1b63ea8bbd9b0bf3f7d9f6 (patch)
treeb82a8b5fc0a309f69733b0a004284f4ef45833d8 /pyload/manager/thread/Plugin.py
parentadded check of classname == filename (diff)
parentMerge branch 'pr/n10_ardi69' into 0.4.10 (diff)
downloadpyload-2f8433b6a10505d29a1b63ea8bbd9b0bf3f7d9f6.tar.xz
Merge pull request #4 from vuolter/0.4.10
vuolter HEAD
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()