Handle IOError for lock file
This commit is contained in:
+5
-4
@@ -61,12 +61,13 @@ def locked(func):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
try:
|
|
||||||
return func(*__args,**__kw)
|
|
||||||
finally:
|
|
||||||
lock.close()
|
|
||||||
except IOError:
|
except IOError:
|
||||||
raise pisi.errors.AnotherInstanceError(_("Another instance of PiSi is running. Only one instance is allowed."))
|
raise pisi.errors.AnotherInstanceError(_("Another instance of PiSi is running. Only one instance is allowed."))
|
||||||
|
|
||||||
|
try:
|
||||||
|
return func(*__args,**__kw)
|
||||||
|
finally:
|
||||||
|
lock.close()
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
def set_userinterface(ui):
|
def set_userinterface(ui):
|
||||||
|
|||||||
Reference in New Issue
Block a user