gh-128509: Use bytes singletons in marshal (#157398) · python/cpython@658612a · GitHub
Skip to content

Commit 658612a

Browse files
authored
gh-128509: Use bytes singletons in marshal (#157398)
Replace soft deprecated PyBytes_FromStringAndSize(NULL, n) with PyBytes_FromStringAndSize(str, n) so marshal can get bytes singleton.
1 parent a60343e commit 658612a

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

Lib/test/test_marshal.py

Lines changed: 8 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:func:`marshal.load` and :func:`marshal.loads` can now get 1-byte string
2+
singletons. Patch by Victor Stinner.

Python/marshal.c

Lines changed: 2 additions & 6 deletions

0 commit comments

Comments
 (0)