Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed9bf12

Browse files
author
Skip Montanaro
committed
protect against test problems with Jython
1 parent d5cf0b8 commit ed9bf12

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Lib/test/test_array.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -602,12 +602,13 @@ def test_buffer(self):
602602

603603
def test_bug_782369(self):
604604
import sys
605-
for i in range(10):
606-
b = array.array('B', range(64))
607-
rc = sys.getrefcount(10)
608-
for i in range(10):
609-
b = array.array('B', range(64))
610-
self.assertEqual(rc, sys.getrefcount(10))
605+
if hasattr(sys, "getrefcount"):
606+
for i in range(10):
607+
b = array.array('B', range(64))
608+
rc = sys.getrefcount(10)
609+
for i in range(10):
610+
b = array.array('B', range(64))
611+
self.assertEqual(rc, sys.getrefcount(10))
611612

612613
class StringTest(BaseTest):
613614

0 commit comments

Comments
 (0)