]> granicus.if.org Git - python/commitdiff
Deal with openbsd's different style of default /etc/hosts by forcing the fqdn
authorAnthony Baxter <anthonybaxter@gmail.com>
Mon, 3 Apr 2006 08:10:33 +0000 (08:10 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Mon, 3 Apr 2006 08:10:33 +0000 (08:10 +0000)
lookup to use the IP address returned by gethosbyname.

Lib/test/test_socket.py

index f9d8313adffa79eb6f74371111a0af55c6592591..46468a63c5bac7bc3e622882a91a57f941dace37 100644 (file)
@@ -268,7 +268,7 @@ class GeneralModuleTests(unittest.TestCase):
             # Probably a similar problem as above; skip this test
             return
         all_host_names = [hostname, hname] + aliases
-        fqhn = socket.getfqdn()
+        fqhn = socket.getfqdn(ip)
         if not fqhn in all_host_names:
             self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))