Skip to content

Commit 802904e

Browse files
Make sure exception is handled when getting tuple item
Co-authored-by: scoder <[email protected]>
1 parent e7cbb7c commit 802904e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lxml.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ static int PyXmlSec_CheckLxmlLibraryVersion(void) {
7272
}
7373

7474
PyObject* major = PyTuple_GetItem(version, 0);
75+
if (major == NULL) {
76+
goto FINALIZE;
77+
}
7578
PyObject* minor = PyTuple_GetItem(version, 1);
76-
77-
if (PyErr_Occurred()) {
79+
if (minor == NULL) {
7880
goto FINALIZE;
7981
}
8082

0 commit comments

Comments
 (0)