[PATCH] Re: Remove duplicated code paths

Nicolas Sebrecht nicolas.s-dev at laposte.net
Sat Dec 4 09:44:59 GMT 2010


On Wed, Dec 01, 2010 at 10:55:25AM +0100, Sebastian Spaeth wrote:
> 
> diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py
> index 5975332..adcd032 100644
> --- a/offlineimap/accounts.py
> +++ b/offlineimap/accounts.py
> @@ -181,27 +181,17 @@ class AccountSynchronizationMixin:

<...>

> +        # loop account synchronization if needed
>          looping = 1
>          while looping:
>              try:
>                  self.sync(siglistener)
>              except:
> -                self.ui.warn("Error occured attempting to sync account " + self.name \
> -                    + ": " + str(sys.exc_info()[1]))
> +                self.ui.warn("Error occured attempting to sync account %s: "
> +                             "%s" % (self.name, sys.exc_info()[1]))
> +
>              finally:
> -                looping = self.sleeper(siglistener) != 2
> +                looping = self.refreshperiod and self.sleeper(siglistener) != 2
>                  self.ui.acctdone(self.name)

We recently got patch to keep backward compatibility with python 2.4
(see commit 54ffc1fc21c446f ). Could you leave off the
try...expect...finally clauses?

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list