Switch to test_support.get_attribute.

This commit is contained in:
Eric Smith 2010-01-27 01:21:15 +00:00
parent 514e77e0ae
commit 59529e1ef6
1 changed files with 23 additions and 22 deletions

View File

@ -204,7 +204,8 @@ class SysModuleTest(unittest.TestCase):
sys.setrecursionlimit(oldlimit) sys.setrecursionlimit(oldlimit)
def test_getwindowsversion(self): def test_getwindowsversion(self):
if hasattr(sys, "getwindowsversion"): # Raise SkipTest if sys doesn't have getwindowsversion attribute
test.test_support.get_attribute(sys, "getwindowsversion")
v = sys.getwindowsversion() v = sys.getwindowsversion()
self.assertEqual(len(v), 5) self.assertEqual(len(v), 5)
self.assertIsInstance(v[0], int) self.assertIsInstance(v[0], int)