Ensure getaddrinfo fallback works when necessary. v2.2_rc96
authorZac Medico <zmedico@gentoo.org>
Thu, 14 Oct 2010 03:44:30 +0000 (20:44 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 14 Oct 2010 03:44:30 +0000 (20:44 -0700)
pym/_emerge/actions.py

index 186e508f7ff61f550b75ea895054b6356ddbbe4e..1a7dd7fbe0ce30f2488229e333d8825633d07cec 100644 (file)
@@ -2109,11 +2109,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                "!!! getaddrinfo failed for '%s': %s\n" % (hostname, e),
                                noiselevel=-1, level=logging.ERROR)
 
-               if not addrinfos:
-                       # With some configurations we need to use the plain hostname
-                       # rather than try to resolve the ip addresses (bug #340817).
-                       uris.append(syncuri)
-               else:
+               if addrinfos:
 
                        AF_INET = socket.AF_INET
                        AF_INET6 = None
@@ -2146,6 +2142,11 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                        "//" + user_name + hostname + port + "/",
                                        "//" + user_name + ip + port + "/", 1))
 
+               if not uris:
+                       # With some configurations we need to use the plain hostname
+                       # rather than try to resolve the ip addresses (bug #340817).
+                       uris.append(syncuri)
+
                # reverse, for use with pop()
                uris.reverse()