Kaydet (Commit) 9647b524 authored tarafından Guido van Rossum's avatar Guido van Rossum

Also skip testHostnameRes() if gethostbyaddr() raises an exception.

üst 71e02946
......@@ -226,7 +226,11 @@ class GeneralModuleTests(unittest.TestCase):
# Probably name lookup wasn't set up right; skip this test
return
self.assert_(ip.find('.') >= 0, "Error resolving host to ip.")
hname, aliases, ipaddrs = socket.gethostbyaddr(ip)
try:
hname, aliases, ipaddrs = socket.gethostbyaddr(ip)
except socket.error:
# Probably a similar problem as above; skip this test
return
all_host_names = [hname] + aliases
fqhn = socket.getfqdn()
if not fqhn in all_host_names:
......
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