diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-05-31 19:01:23 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-05-31 19:01:23 -0500 |
commit | 35a9b1ca1347400bb12e2af3d6b38f2549c5d9dc (patch) | |
tree | 481fd3296a48c2f49bba6d24f2de181157650c55 | |
parent | 776e69b5b37a9f0678f2759c145ed26368aaba3f (diff) | |
parent | 4ba009d8dc36c8dfdbdacfeaad75626565e33baa (diff) | |
download | cpython-git-35a9b1ca1347400bb12e2af3d6b38f2549c5d9dc.tar.gz |
merge 2.7.2 release branch
-rw-r--r-- | Misc/NEWS | 11 | ||||
-rw-r--r-- | Modules/pyexpat.c | 26 |
2 files changed, 16 insertions, 21 deletions
@@ -30,6 +30,17 @@ Tests What's New in Python 2.7.2? =========================== +*Release date: 2011-06-XX* + +Extension Modules +----------------- + +- Issue #1221: Make pyexpat.__version__ equal to the Python version. + + +What's New in Python 2.7.2 release candidate 1? +=============================================== + *Release date: 2011-05-29* Core and Builtins diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 3bd68a9441..3d04ca8c45 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1792,26 +1792,6 @@ static struct PyMethodDef pyexpat_methods[] = { PyDoc_STRVAR(pyexpat_module_documentation, "Python wrapper for Expat parser."); -/* Return a Python string that represents the version number without the - * extra cruft added by revision control, even if the right options were - * given to the "cvs export" command to make it not include the extra - * cruft. - */ -static PyObject * -get_version_string(void) -{ - static char *rcsid = "$Revision$"; - char *rev = rcsid; - int i = 0; - - while (!isdigit(Py_CHARMASK(*rev))) - ++rev; - while (rev[i] != ' ' && rev[i] != '\0') - ++i; - - return PyString_FromStringAndSize(rev, i); -} - /* Initialization function for the module */ #ifndef MODULE_NAME @@ -1841,6 +1821,7 @@ MODULE_INITFUNC(void) PyObject *modelmod_name; PyObject *model_module; PyObject *sys_modules; + PyObject *version; static struct PyExpat_CAPI capi; PyObject* capi_object; @@ -1872,7 +1853,10 @@ MODULE_INITFUNC(void) Py_INCREF(&Xmlparsetype); PyModule_AddObject(m, "XMLParserType", (PyObject *) &Xmlparsetype); - PyModule_AddObject(m, "__version__", get_version_string()); + version = PyString_FromString(PY_VERSION); + if (!version) + return; + PyModule_AddObject(m, "__version__", version); PyModule_AddStringConstant(m, "EXPAT_VERSION", (char *) XML_ExpatVersion()); { |