215 server.quit() |
215 server.quit() |
216 E5MessageBox.information( |
216 E5MessageBox.information( |
217 self, |
217 self, |
218 self.tr("Login Test"), |
218 self.tr("Login Test"), |
219 self.tr("""The login test succeeded.""")) |
219 self.tr("""The login test succeeded.""")) |
220 except (smtplib.SMTPException, socket.error) as e: |
220 except (smtplib.SMTPException, OSError) as e: |
221 if isinstance(e, smtplib.SMTPResponseException): |
221 if isinstance(e, smtplib.SMTPResponseException): |
222 errorStr = e.smtp_error.decode() |
222 errorStr = e.smtp_error.decode() |
223 elif isinstance(e, socket.timeout): |
223 elif isinstance(e, socket.timeout): |
224 errorStr = str(e) |
224 errorStr = str(e) |
225 elif isinstance(e, socket.error): |
225 elif isinstance(e, OSError): |
226 try: |
226 try: |
227 errorStr = e[1] |
227 errorStr = e[1] |
228 except TypeError: |
228 except TypeError: |
229 errorStr = str(e) |
229 errorStr = str(e) |
230 else: |
230 else: |