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
fix
  • Loading branch information
johanliu committed May 20, 2017
commit c4a9927c6855b9bf3581d76c1edae091fbae342f
7 changes: 3 additions & 4 deletions Lib/test/test_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,10 @@ def test_boundary_error_message_with_negative_offset(self):
def test_boundary_error_message_with_large_offset(self):
# Test overflows cause by large offset and value size (issue 30245)
regex = (
"pack_into requires a buffer of at least " + str(sys.maxsize + 4) +
" bytes for packing 4 bytes at offset " + str(sys.maxsize) +
" \(actual buffer size is 10\)"
r'pack_into requires a buffer of at least ' + str(sys.maxsize + 4) +
r' bytes for packing 4 bytes at offset ' + str(sys.maxsize) +
r' \(actual buffer size is 10\)'
)

with self.assertRaisesRegex(struct.error, regex):
struct.pack_into('<I', bytearray(10), sys.maxsize, 1)

Expand Down