Skip to content

Commit 4ca439c

Browse files
committed
Update IP2Proxy.py
Fixed the database checking logic. (#9)
1 parent 4320179 commit 4ca439c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IP2Proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def open(self, filename):
174174
self._licensecode = struct.unpack('B', header_row[30:31])[0]
175175
self._databasesize = struct.unpack('B', header_row[31:32])[0]
176176
if (self._productcode != 2) :
177-
if (self._dbyear > 20 and self._productcode != 0) :
177+
if (self._dbyear <= 20 and self._productcode == 0) :
178178
self._f.close()
179179
del self._f
180180
raise ValueError("Incorrect IP2Location BIN file format. Please make sure that you are using the latest IP2Location BIN file.")

0 commit comments

Comments
 (0)