Skip to content

Commit b184cfe

Browse files
Clear any potential exceptions before Py_XDECREF
Co-authored-by: scoder <[email protected]>
1 parent 8ca3bdc commit b184cfe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lxml.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ static int PyXmlSec_CheckLxmlLibraryVersion(void) {
9191
result = 0;
9292

9393
FINALIZE:
94+
// Clear any errors that may have occurred
95+
PyErr_Clear();
96+
9497
// Cleanup our references, and return the result
9598
Py_XDECREF(lxml);
9699
Py_XDECREF(version);
97100

98-
// Clear any errors that may have occurred
99-
PyErr_Clear();
100-
101101
return result;
102102
}
103103

0 commit comments

Comments
 (0)