diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-26 18:55:48 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-26 18:55:48 (GMT) |
commit | b457b89323e3110159298bb5aa149f56733aaef8 (patch) | |
tree | e9e90486ce55e137e7ccb7b972dfb74c795dfe77 /Lib/platform.py | |
parent | f521b8c6d25544456394e5cd172b6a24d5d958a6 (diff) | |
download | cpython-b457b89323e3110159298bb5aa149f56733aaef8.zip cpython-b457b89323e3110159298bb5aa149f56733aaef8.tar.gz cpython-b457b89323e3110159298bb5aa149f56733aaef8.tar.bz2 |
more and more implementations now support sys.subversion
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 2559798..7863821 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -1311,8 +1311,6 @@ def _sys_version(sys_version=None): 'failed to parse IronPython sys.version: %s' % repr(sys_version)) version, alt_version, compiler = match.groups() - branch = '' - revision = '' buildno = '' builddate = '' @@ -1325,11 +1323,7 @@ def _sys_version(sys_version=None): 'failed to parse Jython sys.version: %s' % repr(sys_version)) version, buildno, builddate, buildtime, _ = match.groups() - branch = '' - revision = '' compiler = sys.platform - buildno = '' - builddate = '' else: # CPython @@ -1340,15 +1334,16 @@ def _sys_version(sys_version=None): repr(sys_version)) version, buildno, builddate, buildtime, compiler = \ match.groups() - if hasattr(sys, 'subversion'): - # sys.subversion was added in Python 2.5 - name, branch, revision = sys.subversion - else: - name = 'CPython' - branch = '' - revision = '' + name = 'CPython' builddate = builddate + ' ' + buildtime + if hasattr(sys, 'subversion'): + # sys.subversion was added in Python 2.5 + _, branch, revision = sys.subversion + else: + branch = '' + revision = '' + # Add the patchlevel version if missing l = string.split(version, '.') if len(l) == 2: |