summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-02-15 17:12:14 +0100
committerClaude Paroz <claude@2xlibre.net>2013-02-15 17:12:14 +0100
commit35185495e3f70f900b542bf95d744f51e5c5cb92 (patch)
treefc89ec1f9598b48b88a40319f761797e2745cfd7
parentb19d83fc12ebbabbaa9d72286f2e4bfa071ff784 (diff)
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.
-rw-r--r--django/contrib/gis/geoip/base.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/contrib/gis/geoip/base.py b/django/contrib/gis/geoip/base.py
index 944240c811..4b8b6e1ed3 100644
--- a/django/contrib/gis/geoip/base.py
+++ b/django/contrib/gis/geoip/base.py
@@ -125,6 +125,8 @@ class GeoIP(object):
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)