Skip to content

Commit

Permalink
Fixed GitHub issue #19.
Browse files Browse the repository at this point in the history
Fixed GitHub issue #19.
  • Loading branch information
ip2location committed Mar 21, 2022
1 parent a6ace87 commit 98b480e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
8.7.2 2022-03-21
* Fixed GitHub issue #19.

8.7.1 2022-03-17
* Updated readme.md.

Expand Down
9 changes: 5 additions & 4 deletions IP2Location.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ def inet_pton(t, addr):
socket.inet_pton = inet_pton

def is_ipv4(hostname):
ip_parts = hostname.split('.')
for i in range(0,len(ip_parts)):
if int(ip_parts[i]) > 255:
return False
pattern = r'^([0-9]{1,3}[.]){3}[0-9]{1,3}$'
ip_parts = hostname.split('.')
if match(pattern, hostname) is not None:
ip_parts = hostname.split('.')
for i in range(0,len(ip_parts)):
if int(ip_parts[i]) > 255:
return False
return 4
return False

Expand Down
2 changes: 1 addition & 1 deletion PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: IP2Location
Version: 8.7.1
Version: 8.7.2
Summary: Python API for IP2Location database
Home-page: http://www.ip2location.com
Author: IP2Location
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# IP2Location 8.7.1
# IP2Location 8.7.2


This is a IP2Location Python library that enables the user to find the country, region or state, city, latitude and longitude, ZIP code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, usage type, address type and IAB category by IP address or hostname originates from. The library reads the geo location information from **IP2Location BIN data** file.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="IP2Location",
version="8.7.1",
version="8.7.2",
author="IP2Location",
author_email="support@ip2location.com",
description="This is an IP geolocation library that enables the user to find the country, region, city, latitude and longitude, ZIP code, time zone, ISP, domain name, area code, weather info, mobile info, elevation, usage type, address type and IAB category from an IP address. It supports both IPv4 and IPv6 lookup.",
Expand Down

0 comments on commit 98b480e

Please sign in to comment.