summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2015-06-25 23:46:00 +0200
committerClaude Paroz <claude@2xlibre.net>2015-06-26 13:41:48 +0200
commit60879a2193fe79b3853c60782fc4f1fdfdd55d63 (patch)
tree4355098f9bf38826b4e7fed5257f1aaa751f9af2
parentad82d0003b5a3694028119bad580b090e994181e (diff)
Loaded real destructor functions before garbage time
This is an alternative patch to the unsuccessful b43b27bcd.
-rw-r--r--django/contrib/gis/geos/prototypes/io.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/contrib/gis/geos/prototypes/io.py b/django/contrib/gis/geos/prototypes/io.py
index de049e460f..656ff922b4 100644
--- a/django/contrib/gis/geos/prototypes/io.py
+++ b/django/contrib/gis/geos/prototypes/io.py
@@ -125,6 +125,11 @@ class IOBase(GEOSBase):
def __init__(self):
# Getting the pointer with the constructor.
self.ptr = self._constructor()
+ # Loading the real destructor function at this point as doing it in
+ # __del__ is too late (import error).
+ self._destructor.func = self._destructor.get_func(
+ *self._destructor.args, **self._destructor.kwargs
+ )
def __del__(self):
# Cleaning up with the appropriate destructor.