Commit ad1f235f by William Tisäter

Remove dead code

parent 0b964257
...@@ -410,13 +410,10 @@ class GeoIP(object): ...@@ -410,13 +410,10 @@ class GeoIP(object):
def _gethostbyname(self, hostname): def _gethostbyname(self, hostname):
if self._databaseType in const.IPV6_EDITIONS: if self._databaseType in const.IPV6_EDITIONS:
try: response = socket.getaddrinfo(hostname, 0, socket.AF_INET6)
response = socket.getaddrinfo(hostname, 0, socket.AF_INET6) family, socktype, proto, canonname, sockaddr = response[0]
family, socktype, proto, canonname, sockaddr = response[0] address, port, flow, scope = sockaddr
address, port, flow, scope = sockaddr return address
return address
except socket.gaierror:
return ''
else: else:
return socket.gethostbyname(hostname) return socket.gethostbyname(hostname)
...@@ -430,10 +427,6 @@ class GeoIP(object): ...@@ -430,10 +427,6 @@ class GeoIP(object):
@return: network byte order 32-bit integer @return: network byte order 32-bit integer
@rtype: int @rtype: int
""" """
COUNTY_EDITIONS = (const.COUNTRY_EDITION, const.COUNTRY_EDITION_V6)
if self._databaseType not in COUNTY_EDITIONS:
raise GeoIPError('Invalid database type, expected Country')
ipv = 6 if addr.find(':') >= 0 else 4 ipv = 6 if addr.find(':') >= 0 else 4
if ipv == 4 and self._databaseType != const.COUNTRY_EDITION: if ipv == 4 and self._databaseType != const.COUNTRY_EDITION:
raise GeoIPError('Invalid database type; expected IPv6 address') raise GeoIPError('Invalid database type; expected IPv6 address')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment