summaryrefslogtreecommitdiffstats
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-07-02 15:44:36 (GMT)
committerFred Drake <fdrake@acm.org>2002-07-02 15:44:36 (GMT)
commitb28467b7137fe5f43f024f8d479a25c45f9f640a (patch)
tree30198916514fdc2d2c508b120e749c68dc6bc741 /Modules/pyexpat.c
parent84262fb1f348a62a0e92bbf5bfdb1fae4de4bee5 (diff)
downloadcpython-b28467b7137fe5f43f024f8d479a25c45f9f640a.zip
cpython-b28467b7137fe5f43f024f8d479a25c45f9f640a.tar.gz
cpython-b28467b7137fe5f43f024f8d479a25c45f9f640a.tar.bz2
Do not depend on pymemcompat.h (was only used for PyXML); Martin likes
it all inline.
Diffstat (limited to 'Modules/pyexpat.c')
-rw-r--r--Modules/pyexpat.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index eac92cb..396986a 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1,10 +1,6 @@
#include "Python.h"
#include <ctype.h>
-#ifdef HAVE_PYMEMCOMPAT_H
-#include "pymemcompat.h"
-#endif
-
#include "compile.h"
#include "frameobject.h"
#include "expat.h"
@@ -973,7 +969,13 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
if (self->buffer != NULL) {
new_parser->buffer = malloc(new_parser->buffer_size);
if (new_parser->buffer == NULL) {
+#ifndef Py_TPFLAGS_HAVE_GC
+ /* Code for versions 2.0 and 2.1 */
+ PyObject_Del(new_parser);
+#else
+ /* Code for versions 2.2 and later. */
PyObject_GC_Del(new_parser);
+#endif
return PyErr_NoMemory();
}
}