Backwards compatibility for python 2.4
Python 2.4 doesn't allow try...except...finally clauses, see PEP 341. Also, yield statements inside try...finally is not allowed. The commit changes the logic to no longer use those syntactical features. Signed-off-by: Nicolas Sebrecht <ni.s@laposte.net>
This commit is contained in:
parent
1deb8442a5
commit
d687999a66
@ -84,8 +84,10 @@ class SigListener(Queue):
|
|||||||
self.folderlock.release()
|
self.folderlock.release()
|
||||||
yield (folder, quick)
|
yield (folder, quick)
|
||||||
self.folderlock.acquire()
|
self.folderlock.acquire()
|
||||||
finally:
|
except:
|
||||||
self.folderlock.release()
|
self.folderlock.release()
|
||||||
|
raise
|
||||||
|
self.folderlock.release()
|
||||||
|
|
||||||
def getaccountlist(customconfig):
|
def getaccountlist(customconfig):
|
||||||
return customconfig.getsectionlist('Account')
|
return customconfig.getsectionlist('Account')
|
||||||
@ -183,10 +185,11 @@ class AccountSynchronizationMixin:
|
|||||||
#might need changes here to ensure that one account sync does not crash others...
|
#might need changes here to ensure that one account sync does not crash others...
|
||||||
if not self.refreshperiod:
|
if not self.refreshperiod:
|
||||||
try:
|
try:
|
||||||
self.sync(siglistener)
|
try:
|
||||||
except:
|
self.sync(siglistener)
|
||||||
self.ui.warn("Error occured attempting to sync account " + self.name \
|
except:
|
||||||
+ ": " + str(sys.exc_info()[1]))
|
self.ui.warn("Error occured attempting to sync account " + self.name \
|
||||||
|
+ ": " + str(sys.exc_info()[1]))
|
||||||
finally:
|
finally:
|
||||||
self.ui.acctdone(self.name)
|
self.ui.acctdone(self.name)
|
||||||
|
|
||||||
@ -196,10 +199,11 @@ class AccountSynchronizationMixin:
|
|||||||
looping = 1
|
looping = 1
|
||||||
while looping:
|
while looping:
|
||||||
try:
|
try:
|
||||||
self.sync(siglistener)
|
try:
|
||||||
except:
|
self.sync(siglistener)
|
||||||
self.ui.warn("Error occured attempting to sync account " + self.name \
|
except:
|
||||||
+ ": " + str(sys.exc_info()[1]))
|
self.ui.warn("Error occured attempting to sync account " + self.name \
|
||||||
|
+ ": " + str(sys.exc_info()[1]))
|
||||||
finally:
|
finally:
|
||||||
looping = self.sleeper(siglistener) != 2
|
looping = self.sleeper(siglistener) != 2
|
||||||
self.ui.acctdone(self.name)
|
self.ui.acctdone(self.name)
|
||||||
|
Loading…
Reference in New Issue
Block a user