Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit102fe3f

Browse files
committed
Further changes following discussion on INTERFACES mailing list:
- Use PyObject_Del() rather than macro version - Check version and drop back to PyMem_Del() for older systems.
1 parenteb32be6 commit102fe3f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

‎src/interfaces/python/pgmodule.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@
3535
#include<stdlib.h>
3636
#include<string.h>
3737

38+
# PyObject_Del does not exist in older versions of Python.
39+
#ifPY_VERSION_HEX<0x01060000
40+
#definePyObject_Del(op) PyMem_Del((op))
41+
#endif
42+
3843
staticPyObject*PGError;
39-
staticconstchar*PyPgVersion="3.3";
44+
staticconstchar*PyPgVersion="3.4 (beta)";
4045

4146
/* taken from fileobject.c */
4247
#defineBUF(v) PyString_AS_STRING((PyStringObject *)(v))
@@ -343,7 +348,7 @@ pgsource_dealloc(pgsourceobject * self)
343348
PQclear(self->last_result);
344349

345350
Py_XDECREF(self->pgcnx);
346-
PyObject_DEL(self);
351+
PyObject_Del(self);
347352
}
348353

349354
/* closes object */
@@ -990,7 +995,7 @@ pglarge_dealloc(pglargeobject * self)
990995
lo_close(self->pgcnx->cnx,self->lo_fd);
991996

992997
Py_XDECREF(self->pgcnx);
993-
PyObject_DEL(self);
998+
PyObject_Del(self);
994999
}
9951000

9961001
/* opens large object */
@@ -1546,7 +1551,7 @@ pg_dealloc(pgobject * self)
15461551
if (self->cnx)
15471552
PQfinish(self->cnx);
15481553

1549-
PyObject_DEL(self);
1554+
PyObject_Del(self);
15501555
}
15511556

15521557
/* close without deleting */
@@ -1579,7 +1584,7 @@ pgquery_dealloc(pgqueryobject * self)
15791584
if (self->last_result)
15801585
PQclear(self->last_result);
15811586

1582-
PyObject_DEL(self);
1587+
PyObject_Del(self);
15831588
}
15841589

15851590
/* resets connection */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp