mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
Closes #22646: Accept list as well as tuple to support initialisation via dictConfig().
This commit is contained in:
commit
c2c62b13ce
1 changed files with 2 additions and 2 deletions
|
@ -931,11 +931,11 @@ class SMTPHandler(logging.Handler):
|
||||||
default is one second).
|
default is one second).
|
||||||
"""
|
"""
|
||||||
logging.Handler.__init__(self)
|
logging.Handler.__init__(self)
|
||||||
if isinstance(mailhost, tuple):
|
if isinstance(mailhost, (list, tuple)):
|
||||||
self.mailhost, self.mailport = mailhost
|
self.mailhost, self.mailport = mailhost
|
||||||
else:
|
else:
|
||||||
self.mailhost, self.mailport = mailhost, None
|
self.mailhost, self.mailport = mailhost, None
|
||||||
if isinstance(credentials, tuple):
|
if isinstance(credentials, (list, tuple)):
|
||||||
self.username, self.password = credentials
|
self.username, self.password = credentials
|
||||||
else:
|
else:
|
||||||
self.username = None
|
self.username = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue