diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-26 21:49:58 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-26 21:49:58 (GMT) |
commit | 5f28b7b7978ad96fef83e2b41017bdd7ab8a082f (patch) | |
tree | 511fa303a1132e525b05b2288a009781d103dc67 /Lib/platform.py | |
parent | b476d597921ab0ef52de1f56a5efa71c65727114 (diff) | |
download | cpython-5f28b7b7978ad96fef83e2b41017bdd7ab8a082f.zip cpython-5f28b7b7978ad96fef83e2b41017bdd7ab8a082f.tar.gz cpython-5f28b7b7978ad96fef83e2b41017bdd7ab8a082f.tar.bz2 |
Merged revisions 70518,70521,70590,70594-70595 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r70518 | matthias.klose | 2009-03-22 08:08:22 -0500 (Sun, 22 Mar 2009) | 2 lines
- Fix comment macro in python.man
........
r70521 | benjamin.peterson | 2009-03-22 12:45:11 -0500 (Sun, 22 Mar 2009) | 1 line
close the file even if an exception occurs #5536
........
r70590 | skip.montanaro | 2009-03-24 19:52:11 -0500 (Tue, 24 Mar 2009) | 1 line
clarify the type of data returned
........
r70594 | marc-andre.lemburg | 2009-03-25 14:44:58 -0500 (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 14:45:33 -0500 (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 c898dd1..04f7f9b 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -1254,10 +1254,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 @@ -1359,8 +1359,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(): @@ -1372,8 +1370,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(_sys_version()[1].split('.')) def python_branch(): |