summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2006-08-16 16:47:07 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2006-08-16 16:47:07 (GMT)
commitdc075b9ddd19ec5930d39f4958f8f80a2d14c8ae (patch)
tree3a8d766cd2aaf675701cb2b236119bbaaea58700 /Modules
parent574cfea99395e85e5458ccc4f2d65f20ee6f1b52 (diff)
downloadcpython-dc075b9ddd19ec5930d39f4958f8f80a2d14c8ae.zip
cpython-dc075b9ddd19ec5930d39f4958f8f80a2d14c8ae.tar.gz
cpython-dc075b9ddd19ec5930d39f4958f8f80a2d14c8ae.tar.bz2
SF#1534630
ignore data that arrives before the opening start tag
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_elementtree.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index c9e524f..f21cf56 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -48,7 +48,7 @@
#include "Python.h"
-#define VERSION "1.0.6-snapshot"
+#define VERSION "1.0.6"
/* -------------------------------------------------------------------- */
/* configuration */
@@ -1599,6 +1599,10 @@ LOCAL(PyObject*)
treebuilder_handle_data(TreeBuilderObject* self, PyObject* data)
{
if (!self->data) {
+ if (self->last == (ElementObject*) Py_None) {
+ /* ignore calls to data before the first call to start */
+ Py_RETURN_NONE;
+ }
/* store the first item as is */
Py_INCREF(data); self->data = data;
} else {