Skip to content

Commit 08e8461

Browse files
authored
Apply suggestion from @methane
1 parent 33dab1b commit 08e8461

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎Lib/test/test_dict.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,13 @@ def test_copy_noncompact(self):
463463
def test_copy_empty_no_memory(self):
464464
import _testcapi
465465
d = {}
466+
d_copy = d.copy
466467
with self.assertRaises(MemoryError):
467-
_testcapi.call_with_nomemory(0, 0, d.copy)
468+
try:
469+
_testcapi.set_nomemory(0)
470+
d_copy()
471+
finally:
472+
_testcapi.remove_mem_hooks()
468473

469474
def test_get(self):
470475
d = {}

0 commit comments

Comments
 (0)