diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index 0b6a867e38..c3250ef72e 100644 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -5,6 +5,7 @@ import collections.abc import unittest from test import support +from test.support import import_helper from test.support import os_helper from test.support import _2G import weakref @@ -1151,9 +1152,9 @@ def test_initialize_with_unicode(self): @support.cpython_only def test_obsolete_write_lock(self): - from _testcapi import getbuffer_with_null_view + _testcapi = import_helper.import_module('_testcapi') a = array.array('B', b"") - self.assertRaises(BufferError, getbuffer_with_null_view, a) + self.assertRaises(BufferError, _testcapi.getbuffer_with_null_view, a) # TODO: RUSTPYTHON @unittest.expectedFailure