Skip to content

Commit 133735a

Browse files
committed
Address @brettcannon's review
1 parent eb6ad56 commit 133735a

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

Lib/test/smtpd.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,25 +77,16 @@
7777
import time
7878
import socket
7979
import collections
80-
from warnings import _deprecated, warn
80+
from test.support.import_helper import import_module
81+
from warnings import warn
8182
from email._header_value_parser import get_addr_spec, get_angle_addr
8283

8384
__all__ = [
8485
"SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy",
8586
]
8687

87-
_DEPRECATION_MSG = ('The {name} module is deprecated and unmaintained and will '
88-
'be removed in Python {remove}. Please see aiosmtpd '
89-
'(https://aiosmtpd.readthedocs.io/) for the recommended '
90-
'replacement.')
91-
_deprecated(__name__, _DEPRECATION_MSG, remove=(3, 12))
92-
93-
94-
# These are imported after the above warning so that users get the correct
95-
# deprecation warning.
96-
import asyncore
97-
import asynchat
98-
88+
asyncore = import_module('asyncore', deprecated=True)
89+
asynchat = import_module('asynchat', deprecated=True)
9990

10091
program = sys.argv[0]
10192
__version__ = 'Python SMTP proxy version 0.3'

Lib/test/test_smtplib.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
from test.support import warnings_helper
2525
from unittest.mock import Mock
2626

27-
from warnings import catch_warnings
28-
with catch_warnings():
29-
from . import smtpd
27+
from . import smtpd
3028

3129
asyncore = warnings_helper.import_deprecated('asyncore')
3230

0 commit comments

Comments
 (0)