From: Skip Montanaro Date: Sun, 3 Aug 2003 23:30:40 +0000 (+0000) Subject: protect against test problems with Jython X-Git-Tag: v2.4a1~1806 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed9bf12848cd00443a72f7259928a6fb01219243;p=python protect against test problems with Jython --- diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index b3fd3fe39f..0331280da6 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -602,12 +602,13 @@ class BaseTest(unittest.TestCase): def test_bug_782369(self): import sys - for i in range(10): - b = array.array('B', range(64)) - rc = sys.getrefcount(10) - for i in range(10): - b = array.array('B', range(64)) - self.assertEqual(rc, sys.getrefcount(10)) + if hasattr(sys, "getrefcount"): + for i in range(10): + b = array.array('B', range(64)) + rc = sys.getrefcount(10) + for i in range(10): + b = array.array('B', range(64)) + self.assertEqual(rc, sys.getrefcount(10)) class StringTest(BaseTest):