]> git.ipfire.org Git - location/libloc.git/blobdiff - src/python/location.in
location: Fix handling of families argument
[location/libloc.git] / src / python / location.in
index 6ced5f5f099064c8001b3f2ca88a2e42a901da44..d37294da18defe3f334384e6aadba43f37e969f9 100644 (file)
@@ -517,10 +517,8 @@ class CLI(object):
                countries, asns = [], []
 
                # Translate family
-               if ns.family == "ipv6":
-                       families = [ socket.AF_INET6 ]
-               elif ns.family == "ipv4":
-                       families = [ socket.AF_INET ]
+               if ns.family:
+                       families = [ ns.family ]
                else:
                        families = [ socket.AF_INET6, socket.AF_INET ]