diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-09-03 21:25:21 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-09-03 21:25:21 (GMT) |
commit | e7e941e7f7a47be54198be79d2280ab3025e5ff1 (patch) | |
tree | 6e08464d26f58b0ae9c681beb52436eab64a6e2b /Lib/test/test_platform.py | |
parent | ffd0dc1e8b99633944d281e200d3789049ef2e7f (diff) | |
download | cpython-e7e941e7f7a47be54198be79d2280ab3025e5ff1.zip cpython-e7e941e7f7a47be54198be79d2280ab3025e5ff1.tar.gz cpython-e7e941e7f7a47be54198be79d2280ab3025e5ff1.tar.bz2 |
test_platform fails on OS X Snow Leopard because the UNIX command to get the
canonical version, sw_vers, leaves off trailing zeros in the version number
(e.g. 10.6 instead of 10.6.0). Test now compensates by tacking on extra zeros
for the test comparison.
Fixes issue #6806.
Diffstat (limited to 'Lib/test/test_platform.py')
-rw-r--r-- | Lib/test/test_platform.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 63d5da21..bd3b234 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -156,7 +156,13 @@ class PlatformTest(unittest.TestCase): break fd.close() self.assertFalse(real_ver is None) - self.assertEquals(res[0], real_ver) + result_list = res[0].split('.') + expect_list = real_ver.split('.') + len_diff = len(result_list) - len(expect_list) + # On Snow Leopard, sw_vers reports 10.6.0 as 10.6 + if len_diff > 0: + expect_list.extend(['0'] * len_diff) + self.assertEquals(result_list, expect_list) # res[1] claims to contain # (version, dev_stage, non_release_version) |