diff options
author | 2015-04-21 06:51:24 +0200 | |
---|---|---|
committer | 2015-04-21 06:51:24 +0200 | |
commit | 2f8433b6a10505d29a1b63ea8bbd9b0bf3f7d9f6 (patch) | |
tree | b82a8b5fc0a309f69733b0a004284f4ef45833d8 /pyload/manager/thread/Plugin.py | |
parent | added check of classname == filename (diff) | |
parent | Merge branch 'pr/n10_ardi69' into 0.4.10 (diff) | |
download | pyload-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.py | 9 |
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() |