Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
_testcapi.PY_SSIZE_T_MAX
  • Loading branch information
StanFromIreland committed Nov 5, 2025
commit 99d1b6b83e71befa4982adbe777196aea463ab63
5 changes: 3 additions & 2 deletions Lib/test/test_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,10 @@ def __int__(self):
operator.mod(format_bytes, value)

# gh-140939: MemoryError is raised without leaking
Comment thread
StanFromIreland marked this conversation as resolved.
with self.assertRaises((MemoryError, OverflowError)):
_testcapi = import_helper.import_module('_testcapi')
with self.assertRaises(MemoryError):
b = self.type2test(b'%*b')
b % (2**63-1, b'abc')
b % (_testcapi.PY_SSIZE_T_MAX, b'abc')

def test_imod(self):
b = self.type2test(b'hello, %b!')
Expand Down
Loading