mirror of
https://github.com/python/cpython.git
synced 2024-11-24 02:15:30 +08:00
#2118: Make SMTPException a subclass of IOError.
Initial patch by Ned Jackson Lovely.
This commit is contained in:
parent
c1d3daf58b
commit
8e37d5df95
@ -103,8 +103,8 @@ A nice selection of exceptions is defined as well:
|
||||
|
||||
.. exception:: SMTPException
|
||||
|
||||
The base exception class for all the other excpetions provided by this
|
||||
module.
|
||||
Subclass of :exc:`IOError` that is the base exception class for all
|
||||
the other excpetions provided by this module.
|
||||
|
||||
|
||||
.. exception:: SMTPServerDisconnected
|
||||
|
@ -151,12 +151,23 @@ New Modules
|
||||
Improved Modules
|
||||
================
|
||||
|
||||
|
||||
doctest
|
||||
-------
|
||||
|
||||
Added ``FAIL_FAST`` flag to halt test running as soon as the first failure is
|
||||
detected. (Contributed by R. David Murray and Daniel Urban in :issue:`16522`.)
|
||||
|
||||
|
||||
smtplib
|
||||
-------
|
||||
|
||||
:exc:`~smtplib.SMTPException` is now a subclass of :exc:`IOError`, which allows
|
||||
both socket level errors and SMTP protocol level errors to be caught in one
|
||||
try/except statement by code that only cares whether or not an error occurred.
|
||||
(:issue:`2118`).
|
||||
|
||||
|
||||
wave
|
||||
----
|
||||
|
||||
|
@ -66,7 +66,7 @@ bCRLF = b"\r\n"
|
||||
OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I)
|
||||
|
||||
# Exception classes used by this module.
|
||||
class SMTPException(Exception):
|
||||
class SMTPException(IOError):
|
||||
"""Base class for all exceptions raised by this module."""
|
||||
|
||||
class SMTPServerDisconnected(SMTPException):
|
||||
|
Loading…
Reference in New Issue
Block a user