def thread_func (username, password): try: OWS_Login.log_in (username, password) except ProtocolError: # Do not give up so easily OWS_Login.log_in (username, password)