diff options
author | Marc-André Lemburg <mal@egenix.com> | 2009-03-25 19:52:04 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2009-03-25 19:52:04 (GMT) |
commit | 152f222775e2d9341830996873685d95419ae2cd (patch) | |
tree | 7759b7ee40922d20f278d65609f96cee99648d33 /Lib/platform.py | |
parent | f70097684ea2889e280caab071d126888bac4073 (diff) | |
download | cpython-152f222775e2d9341830996873685d95419ae2cd.zip cpython-152f222775e2d9341830996873685d95419ae2cd.tar.gz cpython-152f222775e2d9341830996873685d95419ae2cd.tar.bz2 |
Merged revisions 70594-70595 via svnmerge from
svn+pythonssh://pythondev@svn.python.org/python/trunk
........
r70594 | marc-andre.lemburg | 2009-03-25 20:44:58 +0100 (Wed, 25 Mar 2009) | 9 lines
Remove the sys.version_info shortcut, since they cause the APIs
to return different information than the _sys_version() output
used in previous Python versions.
This also fixes issue5561: platform.python_version_tuple returns tuple of ints, should be strings
Added more tests for the various platform functions.
........
r70595 | marc-andre.lemburg | 2009-03-25 20:45:33 +0100 (Wed, 25 Mar 2009) | 3 lines
News item for the platform.py fix (r70594).
........
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 29d55ec..ee18749 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -1296,10 +1296,10 @@ _sys_version_cache = {} def _sys_version(sys_version=None): """ Returns a parsed version of Python's sys.version as tuple - (name, version, branch, revision, buildno, builddate, compiler) - referring to the Python implementation name, version, branch, - revision, build number, build date/time as string and the compiler - identification string. + (name, version, branch, revision, buildno, builddate, compiler) + referring to the Python implementation name, version, branch, + revision, build number, build date/time as string and the compiler + identification string. Note that unlike the Python sys.version, the returned value for the Python version will always include the patchlevel (it @@ -1416,8 +1416,6 @@ def python_version(): will always include the patchlevel (it defaults to 0). """ - if hasattr(sys, 'version_info'): - return '%i.%i.%i' % sys.version_info[:3] return _sys_version()[1] def python_version_tuple(): @@ -1429,8 +1427,6 @@ def python_version_tuple(): will always include the patchlevel (it defaults to 0). """ - if hasattr(sys, 'version_info'): - return sys.version_info[:3] return tuple(string.split(_sys_version()[1], '.')) def python_branch(): |