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.
  • Loading branch information...
claudep committed Feb 15, 2013
1 parent b19d83f commit 35185495e3f70f900b542bf95d744f51e5c5cb92
Showing with 2 additions and 0 deletions.
  1. +2 −0 django/contrib/gis/geoip/
@@ -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

This comment has been minimized.

Show comment Hide comment

dantyan Feb 15, 2013

Iooo ññjjjiií

Iooo ññjjjiií

Please sign in to comment.