Message84161
The documentation for platform.python_version_tuple() says:
"Returns the Python version as tuple (major, minor, patchlevel) of strings."
In 2.4 and 2.5 it correctly returned a tuple of strings. In 2.6 it
returns a tuple of ints.
In 2.4 and 2.5 the implementation was this:
return string.split(_sys_version()[0], '.')
In 2.6 it changed to this:
if hasattr(sys, 'version_info'):
return sys.version_info[:3]
return tuple(string.split(_sys_version()[1], '.'))
The fields used from sys.version_info are ints, and always have been. I
am mystified as to why the "if hasattr" lines were added; they broke it,
and it's not like that's superior information somehow.
I suggest modernizing it slightly when you fix the bug; use the .split()
method on strings. Like so:
return tuple(_sys_version()[1].split('.')) |
|
Date |
User |
Action |
Args |
2009-03-25 16:26:16 | Larry Hastings | set | recipients:
+ Larry Hastings |
2009-03-25 16:26:15 | Larry Hastings | set | messageid: <1237998375.74.0.567262091679.issue5561@psf.upfronthosting.co.za> |
2009-03-25 16:26:14 | Larry Hastings | link | issue5561 messages |
2009-03-25 16:26:13 | Larry Hastings | create | |
|