summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.