summaryrefslogtreecommitdiff
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-03-14 18:11:46 -0700
committerGregory P. Smith <greg@krypto.org>2012-03-14 18:11:46 -0700
commit61ec8d920da3fdc87e435fbdcffc77eee3e549ef (patch)
tree84a75f5dcddb136a1e4074020d5a25a44b2e1b33 /Modules/pyexpat.c
parentc69d66ff955d42936a8518d9b06f7749945e13c9 (diff)
parente49fe90d6f915cb377736ed85e05e3b1fe00547d (diff)
downloadcpython-61ec8d920da3fdc87e435fbdcffc77eee3e549ef.tar.gz
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 a2da67a3fd..fb023298f5 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);