summaryrefslogtreecommitdiffstats
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-03-15 01:11:46 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-03-15 01:11:46 (GMT)
commitc362cbda97fe9e9b4a535138e56f1aec2d64f86d (patch)
tree7ce7c26647d4a33d5d07f58c347ff422d66283b2 /Modules/pyexpat.c
parent3d7c878fe370e59b142bac9bc32c67b4ac9d949e (diff)
parent2522771e4707cea379510d3196d877c92408f6d3 (diff)
downloadcpython-c362cbda97fe9e9b4a535138e56f1aec2d64f86d.zip
cpython-c362cbda97fe9e9b4a535138e56f1aec2d64f86d.tar.gz
cpython-c362cbda97fe9e9b4a535138e56f1aec2d64f86d.tar.bz2
Fixes Issue 14234: fix for the previous commit, keep compilation when
using --with-system-expat working when the system expat does not have salted hash support.
Diffstat (limited to 'Modules/pyexpat.c')
-rw-r--r--Modules/pyexpat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index a2da67a..fb02329 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1156,8 +1156,13 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
else {
self->itself = XML_ParserCreate(encoding);
}
+#if ((XML_MAJOR_VERSION >= 2) && (XML_MINOR_VERSION >= 1)) || defined(XML_HAS_SET_HASH_SALT)
+ /* This feature was added upstream in libexpat 2.1.0. Our expat copy
+ * has a backport of this feature where we also define XML_HAS_SET_HASH_SALT
+ * to indicate that we can still use it. */
XML_SetHashSalt(self->itself,
(unsigned long)_Py_HashSecret.prefix);
+#endif
self->intern = intern;
Py_XINCREF(self->intern);
PyObject_GC_Track(self);