Skip to content

Commit 759fa93

Browse files
author
brett.cannon
committed
Merged revisions 74641 via svnmerge from
svn+ssh://[email protected]/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://[email protected]/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. ........ ................ git-svn-id: http://svn.python.org/projects/python/branches/release31-maint@74642 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent b8d83a4 commit 759fa93

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Lib/test/test_platform.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,13 @@ def test_mac_ver(self):
149149
break
150150
fd.close()
151151
self.assertFalse(real_ver is None)
152-
self.assertEquals(res[0], real_ver)
152+
result_list = res[0].split('.')
153+
expect_list = real_ver.split('.')
154+
len_diff = len(result_list) - len(expect_list)
155+
# On Snow Leopard, sw_vers reports 10.6.0 as 10.6
156+
if len_diff > 0:
157+
expect_list.extend(['0'] * len_diff)
158+
self.assertEquals(result_list, expect_list)
153159

154160
# res[1] claims to contain
155161
# (version, dev_stage, non_release_version)

0 commit comments

Comments
 (0)