diff options
author | Gregory P. Smith <greg@krypto.org> | 2012-03-14 18:12:23 -0700 |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2012-03-14 18:12:23 -0700 |
commit | c10f5c28281014bda8f335248cea47d8edd4015e (patch) | |
tree | 71f53a42638265878677243179b4cb9481bf81bd /Modules/pyexpat.c | |
parent | c8ff46032f2290ef848aea9485d376dc156347bd (diff) | |
download | cpython-git-c10f5c28281014bda8f335248cea47d8edd4015e.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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 3cbe81c791..976908ce9f 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1302,8 +1302,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); #ifdef Py_TPFLAGS_HAVE_GC |