Commit dcdfd22b authored by Georg Brandl's avatar Georg Brandl

bug #1257988: don't bail out on gethostbyname(gethostname()) failure

parent b88e19c1
......@@ -255,7 +255,11 @@ class SMTP:
self.local_hostname = fqdn
else:
# We can't find an fqdn hostname, so use a domain literal
addr = socket.gethostbyname(socket.gethostname())
addr = '127.0.0.1'
try:
addr = socket.gethostbyname(socket.gethostname())
except socket.gaierror:
pass
self.local_hostname = '[%s]' % addr
def set_debuglevel(self, debuglevel):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment