[Python-checkins] r70612 - in python/trunk/Lib: platform.py test/test_platform.py

benjamin.peterson python-checkins at python.org
Thu Mar 26 19:55:48 CET 2009


Author: benjamin.peterson
Date: Thu Mar 26 19:55:48 2009
New Revision: 70612
Log:
more and more implementations now support sys.subversion
Modified:
 python/trunk/Lib/platform.py
 python/trunk/Lib/test/test_platform.py
Modified: python/trunk/Lib/platform.py
==============================================================================
--- python/trunk/Lib/platform.py	(original)
+++ python/trunk/Lib/platform.py	Thu Mar 26 19:55:48 2009
@@ -1311,8 +1311,6 @@
 'failed to parse IronPython sys.version: %s' %
 repr(sys_version))
 version, alt_version, compiler = match.groups()
- branch = ''
- revision = ''
 buildno = ''
 builddate = ''
 
@@ -1325,11 +1323,7 @@
 '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 @@
 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:
Modified: python/trunk/Lib/test/test_platform.py
==============================================================================
--- python/trunk/Lib/test/test_platform.py	(original)
+++ python/trunk/Lib/test/test_platform.py	Thu Mar 26 19:55:48 2009
@@ -73,10 +73,10 @@
 ("IronPython", "2.0.0", "", "", ("", ""),
 ".NET 2.0.50727.3053"),
 ("2.5 (trunk:6107, Mar 26 2009, 13:02:18) \n[Java HotSpot(TM) Client VM (\"Apple Computer, Inc.\")]",
- None, "java1.5.0_16")
+ ('Jython', 'trunk', '6107'), "java1.5.0_16")
 :
- ("Jython", "2.5.0", "", "", ("", ""),
- "java1.5.0_16"),
+ ("Jython", "2.5.0", "trunk", "6107",
+ ('trunk:6107', 'Mar 26 2009'), "java1.5.0_16"),
 }
 for (version_tag, subversion, sys_platform), info in \
 sys_versions.iteritems():


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /