Add ConnectionError handling

This commit is contained in:
László Károlyi 2023-12-16 12:50:31 +01:00
parent 8569fd2128
commit 3f3fcc241c
Signed by: karolyi
GPG key ID: 2DCAF25E55735BFE
3 changed files with 5 additions and 2 deletions

View file

@ -1,3 +1,6 @@
1.0.11:
- Treat connection related errors as ambiguous (e.g. "Connection reset by peer").
1.0.10:
- First pypi-free release (they removed everything between 1.0.6 and 1.0.9).
- Removing unnecessary files from the source tarball.

View file

@ -57,7 +57,7 @@ class BuildPyCommand(build_py):
setup(
name='py3-validate-email',
version='1.0.10',
version='1.0.11',
packages=find_packages(exclude=['tests']),
install_requires=[
'dnspython~=2.2', 'idna~=3.3', 'filelock~=3.7',

View file

@ -175,7 +175,7 @@ class _SMTPChecker(SMTP):
return False
except SMTPResponseException as exc:
return self._handle_smtpresponseexception(exc=exc)
except TLSNegotiationError as exc:
except (TLSNegotiationError, ConnectionError) as exc:
self.__temporary_errors[self._host] = SMTPMessage(
command=self.__command, code=-1, text=str(exc),
exceptions=exc.args)