Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #17066 -- Prevented TypeError in GeoIP.__del__

When garbaging GeoIP instances, it happens that GeoIP_delete is
already None.
Thanks mitar for the report and stefanw for tests.
commit 35185495e3f70f900b542bf95d744f51e5c5cb92 1 parent b19d83f
@claudep claudep authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  django/contrib/gis/geoip/base.py
View
2  django/contrib/gis/geoip/base.py
@@ -125,6 +125,8 @@ def __init__(self, path=None, cache=0, country=None, city=None):
def __del__(self):
# Cleaning any GeoIP file handles lying around.
+ if GeoIP_delete is None:
+ return
if self._country: GeoIP_delete(self._country)
if self._city: GeoIP_delete(self._city)

1 comment on commit 3518549

@dantyan

Iooo ññjjjiií

Please sign in to comment.
Something went wrong with that request. Please try again.