summaryrefslogtreecommitdiffstats
path: root/module/Utils.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-18 14:37:00 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-18 14:37:00 +0200
commit40fc4979e4ca1f2a74972f68a88212b16cc26458 (patch)
tree9d1900929441be5d88f2c8a4602c5249d64f9a51 /module/Utils.py
parentfixes setup unicode errors (diff)
downloadpyload-40fc4979e4ca1f2a74972f68a88212b16cc26458.tar.xz
some more locks
Diffstat (limited to 'module/Utils.py')
-rw-r--r--module/Utils.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/module/Utils.py b/module/Utils.py
index 45fa81d52..0ba3fb035 100644
--- a/module/Utils.py
+++ b/module/Utils.py
@@ -144,10 +144,12 @@ def parseFileSize(string): #returns bytes
def lock(func):
def new(*args):
+ #print "Handler: %s args: %s" % (func,args[1:])
args[0].lock.acquire()
- res = func(*args)
- args[0].lock.release()
- return res
+ try:
+ return func(*args)
+ finally:
+ args[0].lock.release()
return new