Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address @brettcannon's review
  • Loading branch information
arhadthedev committed Jun 8, 2022
commit 133735a71e26885c05c32a44c0fd94de1171684e
17 changes: 4 additions & 13 deletions Lib/test/smtpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,16 @@
import time
import socket
import collections
from warnings import _deprecated, warn
from test.support.import_helper import import_module
from warnings import warn
from email._header_value_parser import get_addr_spec, get_angle_addr

__all__ = [
"SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy",
]

_DEPRECATION_MSG = ('The {name} module is deprecated and unmaintained and will '
'be removed in Python {remove}. Please see aiosmtpd '
'(https://aiosmtpd.readthedocs.io/) for the recommended '
'replacement.')
_deprecated(__name__, _DEPRECATION_MSG, remove=(3, 12))


# These are imported after the above warning so that users get the correct
# deprecation warning.
import asyncore
import asynchat

asyncore = import_module('asyncore', deprecated=True)
asynchat = import_module('asynchat', deprecated=True)

program = sys.argv[0]
__version__ = 'Python SMTP proxy version 0.3'
Expand Down
4 changes: 1 addition & 3 deletions Lib/test/test_smtplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
from test.support import warnings_helper
from unittest.mock import Mock

from warnings import catch_warnings
with catch_warnings():
from . import smtpd
from . import smtpd

asyncore = warnings_helper.import_deprecated('asyncore')

Expand Down