Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pygeoip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pygeoip
Commits
639b3ef5
Commit
639b3ef5
authored
Jun 05, 2013
by
William Tisäter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix _get_record, only return None from record_by_addr
parent
a95b41f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
pygeoip/__init__.py
+6
-2
No files found.
pygeoip/__init__.py
View file @
639b3ef5
...
@@ -324,7 +324,7 @@ class GeoIP(GeoIPBase):
...
@@ -324,7 +324,7 @@ class GeoIP(GeoIPBase):
"""
"""
seek_country
=
self
.
_seek_country
(
ipnum
)
seek_country
=
self
.
_seek_country
(
ipnum
)
if
seek_country
==
self
.
_databaseSegments
:
if
seek_country
==
self
.
_databaseSegments
:
return
None
return
{}
read_length
=
(
2
*
self
.
_recordLength
-
1
)
*
self
.
_databaseSegments
read_length
=
(
2
*
self
.
_recordLength
-
1
)
*
self
.
_databaseSegments
self
.
_lock
.
acquire
()
self
.
_lock
.
acquire
()
...
@@ -572,7 +572,11 @@ class GeoIP(GeoIPBase):
...
@@ -572,7 +572,11 @@ class GeoIP(GeoIPBase):
message
=
'Invalid database type, expected City'
message
=
'Invalid database type, expected City'
raise
GeoIPError
(
message
)
raise
GeoIPError
(
message
)
return
self
.
_get_record
(
ipnum
)
rec
=
self
.
_get_record
(
ipnum
)
if
not
rec
:
return
None
return
rec
except
ValueError
:
except
ValueError
:
raise
GeoIPError
(
'Failed to lookup address
%
s'
%
addr
)
raise
GeoIPError
(
'Failed to lookup address
%
s'
%
addr
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment