diff --git a/src/interfaces/python/pgmodule.c b/src/interfaces/python/pgmodule.c
index 51f63d2d9ebfcd26b875de2b636ef3a210dc4c7b..a9f8023d2014bb0c45360e2957e4a00503fffcda 100644
--- a/src/interfaces/python/pgmodule.c
+++ b/src/interfaces/python/pgmodule.c
@@ -343,7 +343,7 @@ pgsource_dealloc(pgsourceobject * self)
 		PQclear(self->last_result);
 
 	Py_XDECREF(self->pgcnx);
-	PyMem_DEL(self);
+	PyObject_DEL(self);
 }
 
 /* closes object */
@@ -990,7 +990,7 @@ pglarge_dealloc(pglargeobject * self)
 		lo_close(self->pgcnx->cnx, self->lo_fd);
 
 	Py_XDECREF(self->pgcnx);
-	PyMem_DEL(self);
+	PyObject_DEL(self);
 }
 
 /* opens large object */
@@ -1546,7 +1546,7 @@ pg_dealloc(pgobject * self)
 	if (self->cnx)
 		PQfinish(self->cnx);
 
-	PyMem_DEL(self);
+	PyObject_DEL(self);
 }
 
 /* close without deleting */
@@ -1579,7 +1579,7 @@ pgquery_dealloc(pgqueryobject * self)
 	if (self->last_result)
 		PQclear(self->last_result);
 
-	PyMem_DEL(self);
+	PyObject_DEL(self);
 }
 
 /* resets connection */