diff Lib/test/test_array.py @ 30040:643ffb7db18f legacy-trunk

protect against test problems with Jython
author Skip Montanaro <skip@pobox.com>
date Sun, 03 Aug 2003 23:30:40 +0000
parents d8c8fe0c73ed
children 35cb8114b45c
line wrap: on
line diff
--- a/Lib/test/test_array.py	Sun Aug 03 23:02:10 2003 +0000
+++ b/Lib/test/test_array.py	Sun Aug 03 23:30:40 2003 +0000
@@ -602,12 +602,13 @@
 
     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):