mirror of
https://github.com/python/cpython.git
synced 2024-11-24 02:15:30 +08:00
#2118: IOError is deprecated, use OSError.
This commit is contained in:
parent
96d6a78ce0
commit
8a34596bbe
@ -103,7 +103,7 @@ A nice selection of exceptions is defined as well:
|
||||
|
||||
.. exception:: SMTPException
|
||||
|
||||
Subclass of :exc:`IOError` that is the base exception class for all
|
||||
Subclass of :exc:`OSError` that is the base exception class for all
|
||||
the other excpetions provided by this module.
|
||||
|
||||
|
||||
|
@ -162,7 +162,7 @@ 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
|
||||
:exc:`~smtplib.SMTPException` is now a subclass of :exc:`OSError`, 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`).
|
||||
|
@ -66,7 +66,7 @@ bCRLF = b"\r\n"
|
||||
OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I)
|
||||
|
||||
# Exception classes used by this module.
|
||||
class SMTPException(IOError):
|
||||
class SMTPException(OSError):
|
||||
"""Base class for all exceptions raised by this module."""
|
||||
|
||||
class SMTPServerDisconnected(SMTPException):
|
||||
|
Loading…
Reference in New Issue
Block a user