[Kolab-devel] Upgrade report 3.1 to 3.2 on Debian Wheezy

Paul Boddie paul at boddie.org.uk
Sun Feb 16 13:20:34 CET 2014


On Sunday 16. February 2014 11.28.39 Jeroen van Meeuwen (Kolab Systems) wrote:
> 
> That's something new for me, I wasn't aware of try/except/else to be
> honest. I just committed something different with connected being set to
> True right after primary_auth.connect().

Well, the following is effectively equivalent:

            while 1:
                try:
                    primary_auth.connect()
                    break
                except Exception, errmsg:
                    log.error(_("Could not connect to LDAP, is it running?"))
                    time.sleep(5)

The else clause is pretty narrow in terms of benefits, really.

Paul


More information about the devel mailing list