Skip to content

Commit 0ae0bff

Browse files
committed
Use backport of ipaddress for Python 2 instead of ipaddr
1 parent 964a62e commit 0ae0bff

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Requirements
8383
This code requires Python 2.6+ or 3.3+. The C extension requires CPython. The
8484
pure Python implementation has been tested with PyPy.
8585

86-
On Python 2, the `ipaddr module <https://code.google.com/p/ipaddr-py/>`_ is
86+
On Python 2, the `ipaddress module <https://pypi.python.org/pypi/ipaddress>`_ is
8787
required.
8888

8989
Versioning

maxminddb/compat.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
# pylint: skip-file
44

55
if sys.version_info[0] == 2:
6-
import ipaddr as ipaddress # pylint:disable=F0401
7-
ipaddress.ip_address = ipaddress.IPAddress
8-
96
int_from_byte = ord
107

118
FileNotFoundError = IOError
@@ -17,8 +14,6 @@ def int_from_bytes(b):
1714

1815
byte_from_int = chr
1916
else:
20-
import ipaddress # pylint:disable=F0401
21-
2217
int_from_byte = lambda x: x
2318

2419
FileNotFoundError = FileNotFoundError

maxminddb/reader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
mmap = None
1515

1616
import struct
17+
import ipaddress
1718

18-
from maxminddb.compat import byte_from_int, int_from_byte, ipaddress
19+
from maxminddb.compat import byte_from_int, int_from_byte
1920
from maxminddb.const import MODE_AUTO, MODE_MMAP, MODE_FILE, MODE_MEMORY
2021
from maxminddb.decoder import Decoder
2122
from maxminddb.errors import InvalidDatabaseError

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
if sys.version_info[0] == 2 or (sys.version_info[0] == 3
2424
and sys.version_info[1] < 3):
25-
requirements.append('ipaddr')
25+
requirements.append('ipaddress')
2626

2727
compile_args = ['-Wall', '-Wextra']
2828

0 commit comments

Comments
 (0)