Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a22c98de
Commit
a22c98de
authored
May 31, 2011
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simply use the Python version for pyexpat.__version__ #12221
parent
bb11bb0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
21 deletions
+15
-21
Misc/NEWS
Misc/NEWS
+10
-0
Modules/pyexpat.c
Modules/pyexpat.c
+5
-21
No files found.
Misc/NEWS
View file @
a22c98de
...
...
@@ -2,6 +2,16 @@
Python News
+++++++++++
What's New in Python 3.1.4?
===========================
*Release date: 2011-05-XX*
Extension Modules
-----------------
- Issue #12221: Replace pyexpat.__version__ with the Python version.
What's New in Python 3.1.4 release candidate 1?
===============================================
...
...
Modules/pyexpat.c
View file @
a22c98de
...
...
@@ -1730,26 +1730,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
PyUnicode_FromStringAndSize
(
rev
,
i
);
}
/* Initialization function for the module */
#ifndef MODULE_NAME
...
...
@@ -1790,6 +1770,7 @@ MODULE_INITFUNC(void)
PyObject
*
errors_module
;
PyObject
*
modelmod_name
;
PyObject
*
model_module
;
PyObject
*
version
;
PyObject
*
sys_modules
;
static
struct
PyExpat_CAPI
capi
;
PyObject
*
capi_object
;
...
...
@@ -1822,7 +1803,10 @@ MODULE_INITFUNC(void)
Py_INCREF
(
&
Xmlparsetype
);
PyModule_AddObject
(
m
,
"XMLParserType"
,
(
PyObject
*
)
&
Xmlparsetype
);
PyModule_AddObject
(
m
,
"__version__"
,
get_version_string
());
version
=
PyUnicode_FromString
(
PY_VERSION
);
if
(
!
version
)
return
;
PyModule_AddObject
(
m
,
"__version__"
,
version
);
PyModule_AddStringConstant
(
m
,
"EXPAT_VERSION"
,
(
char
*
)
XML_ExpatVersion
());
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment