]> granicus.if.org Git - python/commitdiff
protect against test problems with Jython
authorSkip Montanaro <skip@pobox.com>
Sun, 3 Aug 2003 23:30:40 +0000 (23:30 +0000)
committerSkip Montanaro <skip@pobox.com>
Sun, 3 Aug 2003 23:30:40 +0000 (23:30 +0000)
Lib/test/test_array.py

index b3fd3fe39f71692e9f1349bbc3dd1cde81d3192c..0331280da624626a367acaa462400fce65a241c9 100755 (executable)
@@ -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):