summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2013-07-19 09:14:05 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2013-07-19 09:14:05 (GMT)
commitced1226cce611f7668e3f3211ba5bec21c195c33 (patch)
tree06e07498d10fcb4ccc06adf721889693546d55ea /Modules/_elementtree.c
parentf24bb35a69d18a05047399eadc63b4be092aee71 (diff)
parent138d080a28431a3437601e3297e7fe5d39edb574 (diff)
downloadcpython-ced1226cce611f7668e3f3211ba5bec21c195c33.zip
cpython-ced1226cce611f7668e3f3211ba5bec21c195c33.tar.gz
cpython-ced1226cce611f7668e3f3211ba5bec21c195c33.tar.bz2
(3.3->default): #18480: Add missing PyType_Ready call to _elementtree extension
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r--Modules/_elementtree.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index acefd7b..28bdf1e 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -59,6 +59,13 @@ do { memory -= size; printf("%8d - %s\n", memory, comment); } while (0)
#define JOIN_SET(p, flag) ((void*) ((Py_uintptr_t) (JOIN_OBJ(p)) | (flag)))
#define JOIN_OBJ(p) ((PyObject*) ((Py_uintptr_t) (p) & ~(Py_uintptr_t)1))
+/* Types defined by this extension */
+static PyTypeObject Element_Type;
+static PyTypeObject ElementIter_Type;
+static PyTypeObject TreeBuilder_Type;
+static PyTypeObject XMLParser_Type;
+
+
/* glue functions (see the init function for details) */
static PyObject* elementtree_parseerror_obj;
static PyObject* elementtree_deepcopy_obj;
@@ -159,7 +166,6 @@ typedef struct {
} ElementObject;
-static PyTypeObject Element_Type;
#define Element_CheckExact(op) (Py_TYPE(op) == &Element_Type)
@@ -2182,8 +2188,6 @@ typedef struct {
PyObject *end_ns_event_obj;
} TreeBuilderObject;
-static PyTypeObject TreeBuilder_Type;
-
#define TreeBuilder_CheckExact(op) (Py_TYPE(op) == &TreeBuilder_Type)
/* -------------------------------------------------------------------- */
@@ -2693,8 +2697,6 @@ typedef struct {
} XMLParserObject;
-static PyTypeObject XMLParser_Type;
-
#define XMLParser_CheckExact(op) (Py_TYPE(op) == &XMLParser_Type)
/* helpers */
@@ -3654,6 +3656,8 @@ PyInit__elementtree(void)
PyObject *m, *temp;
/* Initialize object types */
+ if (PyType_Ready(&ElementIter_Type) < 0)
+ return NULL;
if (PyType_Ready(&TreeBuilder_Type) < 0)
return NULL;
if (PyType_Ready(&Element_Type) < 0)