diff --git a/Lib/test/test_capi/test_unicode.py b/Lib/test/test_capi/test_unicode.py index 50fdb7647ed377..cf181c5b201eef 100644 --- a/Lib/test/test_capi/test_unicode.py +++ b/Lib/test/test_capi/test_unicode.py @@ -1842,7 +1842,9 @@ def test_check_interned(self): def fresh_string(text): # Create a new string object by decoding a bytes string. - return text.encode().decode() + # Add a suffix to make sure that it's not interned, even if + # the string is interned in the PYC file (Free Threading). + return (text + ' suffix').encode().decode() s = fresh_string('hello') self.assertEqual(check_interned(s), SSTATE_NOT_INTERNED)