Skip to content

Commit be895b2

Browse files
committed
update
1 parent edf51d3 commit be895b2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ipdb/database.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import ipaddress
77
import json
8+
import sys
89
from .meta import MetaData
910
from .info import IPInfo
1011
from .util import bytes2long
@@ -27,7 +28,10 @@ def __init__(self, name):
2728
self._file_size = len(self.data)
2829

2930
meta_length = bytes2long(self.data[0], self.data[1], self.data[2], self.data[3])
30-
meta = json.loads(str(self.data[4:meta_length+4], 'utf-8'))
31+
if sys.version_info < (3,0):
32+
meta = json.loads(str(self.data[4:meta_length + 4]))
33+
else:
34+
meta = json.loads(str(self.data[4:meta_length + 4], 'utf-8'))
3135

3236
self._meta = MetaData(**meta)
3337
if len(self._meta.languages) == 0 or len(self._meta.fields) == 0:

setup.py

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

55
setup(
66
name='ipip-ipdb',
7-
version="0.2.7",
7+
version="0.2.8",
88
description=(
99
'IPIP.net officially supported IP database ipdb format parsing library'
1010
),

0 commit comments

Comments
 (0)