Skip to content

Commit 154eda5

Browse files
committed
gh-145301: Fix double-free in hmac module initialization
1 parent d791cd9 commit 154eda5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Lib/test/test_hashlib.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def get_fips_mode():
6868

6969
requires_sha3 = unittest.skipUnless(_sha3, 'requires _sha3')
7070

71-
_testcapi = import_helper.import_module('_testcapi')
7271

7372
def hexstr(s):
7473
assert isinstance(s, bytes), repr(s)
@@ -1205,12 +1204,10 @@ def test_readonly_types(self):
12051204
hash_type.value = False
12061205

12071206
@unittest.skipUnless(HASH is not None, 'need _hashlib')
1208-
@unittest.skipUnless(hasattr(_testcapi, 'set_nomemory'),
1209-
'need _testcapi.set_nomemory()')
12101207
def test_hashlib_init_memory_error_no_df(self):
12111208
"""gh-145301 regression test."""
1209+
import_helper.import_module('_testcapi')
12121210
code = textwrap.dedent("""
1213-
import sys
12141211
import _testcapi
12151212
_testcapi.set_nomemory(40, 41)
12161213
try:

0 commit comments

Comments
 (0)