diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-09-03 21:32:00 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-09-03 21:32:00 (GMT) |
commit | 04ee867b6dbe0c5002cb5ee45866e8ad73cb636a (patch) | |
tree | 6cf4bffd47db8b2db2393b0074f82685a2be6030 /Lib/test/test_platform.py | |
parent | 7baf625bab07456074a0ef9c8493ea1ed72c338e (diff) | |
download | cpython-04ee867b6dbe0c5002cb5ee45866e8ad73cb636a.zip cpython-04ee867b6dbe0c5002cb5ee45866e8ad73cb636a.tar.gz cpython-04ee867b6dbe0c5002cb5ee45866e8ad73cb636a.tar.bz2 |
Merged revisions 74641 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r74641 | brett.cannon | 2009-09-03 14:29:20 -0700 (Thu, 03 Sep 2009) | 14 lines
Merged revisions 74640 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74640 | brett.cannon | 2009-09-03 14:25:21 -0700 (Thu, 03 Sep 2009) | 7 lines
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 8b1815e..9b75234 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -149,7 +149,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) |