]> granicus.if.org Git - python/commitdiff
When using the latest & greatest version of Expat (currently in the Expat
authorFred Drake <fdrake@acm.org>
Thu, 21 Dec 2000 17:25:07 +0000 (17:25 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 21 Dec 2000 17:25:07 +0000 (17:25 +0000)
CVS repository), provide the library version information.

Modules/pyexpat.c

index ab0b840fd46137c6804f00b5559c423cdbbe5ad2..184678a8144d665e2ada24340066b15ab12c0abd 100644 (file)
@@ -926,6 +926,13 @@ initpyexpat(void)
 
     PyModule_AddObject(m, "__version__",
                        PyString_FromStringAndSize(rev+11, strlen(rev+11)-2));
+#ifdef XML_MAJOR_VERSION
+    PyModule_AddStringConstant(m, "EXPAT_VERSION",
+                               (char *) XML_ExpatVersion());
+    PyModule_AddObject(m, "version_info",
+                       Py_BuildValue("(iii)", XML_MAJOR_VERSION,
+                                     XML_MINOR_VERSION, XML_MICRO_VERSION));
+#endif
 
     /* XXX When Expat supports some way of figuring out how it was
        compiled, this should check and set native_encoding