Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 738293d

Browse files
committed
When using the latest & greatest version of Expat (currently in the Expat
CVS repository), provide the library version information.
1 parent e412e7a commit 738293d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Modules/pyexpat.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,13 @@ initpyexpat(void)
926926

927927
PyModule_AddObject(m, "__version__",
928928
PyString_FromStringAndSize(rev+11, strlen(rev+11)-2));
929+
#ifdef XML_MAJOR_VERSION
930+
PyModule_AddStringConstant(m, "EXPAT_VERSION",
931+
(char *) XML_ExpatVersion());
932+
PyModule_AddObject(m, "version_info",
933+
Py_BuildValue("(iii)", XML_MAJOR_VERSION,
934+
XML_MINOR_VERSION, XML_MICRO_VERSION));
935+
#endif
929936

930937
/* XXX When Expat supports some way of figuring out how it was
931938
compiled, this should check and set native_encoding

0 commit comments

Comments
 (0)