]> granicus.if.org Git - python/commitdiff
Also skip testHostnameRes() if gethostbyaddr() raises an exception.
authorGuido van Rossum <guido@python.org>
Thu, 26 Dec 2002 17:04:45 +0000 (17:04 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 26 Dec 2002 17:04:45 +0000 (17:04 +0000)
Lib/test/test_socket.py

index 11883a88575cf1e22cf46e8d6cfd646f87560d80..bca1c6cabd12da9ab71f8ed33ba5c3115a5317e0 100644 (file)
@@ -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: