Skip to content

Commit

Permalink
Remove PyXmlSec_CheckLibXmlLibraryVersion check
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Mar 25, 2024
1 parent ee9fbd0 commit 497971c
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/lxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ long PyXmlSec_GetLibXmlCompiledVersionPatch() {
return XMLSEC_EXTRACT_PATCH(LIBXML_VERSION);
}

static int PyXmlSec_CheckLibXmlLibraryVersion(void) {
// Make sure that the version of libxml2 that we were compiled against is the same as the one
// that is loaded. If there is a version mismatch, we could run into segfaults.

if (PyXmlSec_GetLibXmlVersionMajor() != PyXmlSec_GetLibXmlCompiledVersionMajor() ||
PyXmlSec_GetLibXmlVersionMinor() != PyXmlSec_GetLibXmlCompiledVersionMinor()) {
return -1;
}

return 0;
}

static int PyXmlSec_CheckLxmlLibraryVersion(void) {
// Make sure that the version of libxml2 lxml is using is the same as the one we are using. Because
// we pass trees between the two libraries, we need to make sure that they are using the same version
Expand Down Expand Up @@ -104,11 +92,6 @@ static int PyXmlSec_CheckLxmlLibraryVersion(void) {
}

int PyXmlSec_InitLxmlModule(void) {
if (PyXmlSec_CheckLibXmlLibraryVersion() < 0) {
PyXmlSec_SetLastError("xmlsec libxml2 library compiled version vs runtime version mismatch");
return -1;
}

if (PyXmlSec_CheckLxmlLibraryVersion() < 0) {
PyXmlSec_SetLastError("lxml & xmlsec libxml2 library version mismatch");
return -1;
Expand Down

0 comments on commit 497971c

Please sign in to comment.