Refs #23763 -- Fixed SMTPServer Python 3.5 deprecation warning in mail test.

This commit is contained in:
Tim Graham 2015-05-18 09:23:06 -04:00
parent f5da438072
commit 7d97c5745e
1 changed files with 3 additions and 0 deletions

View File

@ -868,6 +868,9 @@ class FakeSMTPServer(smtpd.SMTPServer, threading.Thread):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
threading.Thread.__init__(self) threading.Thread.__init__(self)
# New kwarg added in Python 3.5; default switching to False in 3.6.
if sys.version_info >= (3, 5):
kwargs['decode_data'] = True
smtpd.SMTPServer.__init__(self, *args, **kwargs) smtpd.SMTPServer.__init__(self, *args, **kwargs)
self._sink = [] self._sink = []
self.active = False self.active = False