diff options
Diffstat (limited to 'Lib/smtpd.py')
-rwxr-xr-x | Lib/smtpd.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/smtpd.py b/Lib/smtpd.py index 569b42e222..d828c5f12f 100755 --- a/Lib/smtpd.py +++ b/Lib/smtpd.py @@ -610,7 +610,8 @@ class SMTPServer(asyncore.dispatcher): self._decode_data = decode_data asyncore.dispatcher.__init__(self, map=map) try: - self.create_socket(socket.AF_INET, socket.SOCK_STREAM) + gai_results = socket.getaddrinfo(*localaddr) + self.create_socket(gai_results[0][0], gai_results[0][1]) # try to re-use a server port if possible self.set_reuse_addr() self.bind(localaddr) |