diff options
author | Guido van Rossum <guido@python.org> | 2002-12-26 17:04:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-12-26 17:04:45 (GMT) |
commit | 9647b5240cb407a04d09dba0aa54058f3a07f460 (patch) | |
tree | 9c7c2d6cc6bea36298b75bf4ee3d5bdc09e8261d /Lib/test/test_socket.py | |
parent | 71e02946ff022adfa391af864638675788e1f044 (diff) | |
download | cpython-9647b5240cb407a04d09dba0aa54058f3a07f460.zip cpython-9647b5240cb407a04d09dba0aa54058f3a07f460.tar.gz cpython-9647b5240cb407a04d09dba0aa54058f3a07f460.tar.bz2 |
Also skip testHostnameRes() if gethostbyaddr() raises an exception.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 11883a8..bca1c6c 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -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: |