@@ -1622,26 +1622,6 @@ static struct PyMethodDef pyexpat_methods[] = {
16221622PyDoc_STRVAR (pyexpat_module_documentation ,
16231623"Python wrapper for Expat parser." );
16241624
1625- /* Return a Python string that represents the version number without the
1626- * extra cruft added by revision control, even if the right options were
1627- * given to the "cvs export" command to make it not include the extra
1628- * cruft.
1629- */
1630- static PyObject *
1631- get_version_string (void )
1632- {
1633- static char * rcsid = "$Revision$" ;
1634- char * rev = rcsid ;
1635- int i = 0 ;
1636-
1637- while (!isdigit (Py_CHARMASK (* rev )))
1638- ++ rev ;
1639- while (rev [i ] != ' ' && rev [i ] != '\0' )
1640- ++ i ;
1641-
1642- return PyUnicode_FromStringAndSize (rev , i );
1643- }
1644-
16451625/* Initialization function for the module */
16461626
16471627#ifndef MODULE_NAME
@@ -1682,6 +1662,7 @@ MODULE_INITFUNC(void)
16821662 PyObject * errors_module ;
16831663 PyObject * modelmod_name ;
16841664 PyObject * model_module ;
1665+ PyObject * version ;
16851666 PyObject * sys_modules ;
16861667 PyObject * tmpnum , * tmpstr ;
16871668 PyObject * codes_dict ;
@@ -1718,7 +1699,10 @@ MODULE_INITFUNC(void)
17181699 Py_INCREF (& Xmlparsetype );
17191700 PyModule_AddObject (m , "XMLParserType" , (PyObject * ) & Xmlparsetype );
17201701
1721- PyModule_AddObject (m , "__version__" , get_version_string ());
1702+ version = PyUnicode_FromString (PY_VERSION );
1703+ if (!version )
1704+ return ;
1705+ PyModule_AddObject (m , "__version__" , version );
17221706 PyModule_AddStringConstant (m , "EXPAT_VERSION" ,
17231707 (char * ) XML_ExpatVersion ());
17241708 {
0 commit comments