Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7c75bf2

Browse files
committed
Bring this back into sync with PyXML revision 1.58.
1 parent 19b74c7 commit 7c75bf2

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Modules/pyexpat.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#include "Python.h"
22
#include <ctype.h>
33

4+
#ifdef HAVE_PYMEMCOMPAT_H
5+
#include "pymemcompat.h"
6+
#endif
7+
48
#include "compile.h"
59
#include "frameobject.h"
610
#include "expat.h"
711

812
#ifndef PyDoc_STRVAR
13+
#define PyDoc_STR(str) (str)
14+
#define PyDoc_VAR(name) static char name[]
915
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
1016
#endif
1117

@@ -1160,14 +1166,15 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
11601166
}
11611167
XML_SetUserData(self->itself, (void *)self);
11621168
#ifdef Py_USING_UNICODE
1163-
XML_SetUnknownEncodingHandler(self->itself, (XML_UnknownEncodingHandler) PyUnknownEncodingHandler, NULL);
1169+
XML_SetUnknownEncodingHandler(self->itself,
1170+
(XML_UnknownEncodingHandler) PyUnknownEncodingHandler, NULL);
11641171
#endif
11651172

11661173
for (i = 0; handler_info[i].name != NULL; i++)
11671174
/* do nothing */;
11681175

1169-
self->handlers = malloc(sizeof(PyObject *)*i);
1170-
if (!self->handlers){
1176+
self->handlers = malloc(sizeof(PyObject *) * i);
1177+
if (!self->handlers) {
11711178
Py_DECREF(self);
11721179
return PyErr_NoMemory();
11731180
}

0 commit comments

Comments
 (0)