summaryrefslogtreecommitdiffstats
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2022-04-01 11:28:50 (GMT)
committerGitHub <noreply@github.com>2022-04-01 11:28:50 (GMT)
commitae9de82e321581e1906c6ef2a7ad83ab30ae3325 (patch)
tree27210ded3d9f8ae82d99ef7442964174e371ae3e /Objects/codeobject.c
parentbd2e47c8830d1b2869f2b4345945a5e0c3b4e3fb (diff)
downloadcpython-ae9de82e321581e1906c6ef2a7ad83ab30ae3325.zip
cpython-ae9de82e321581e1906c6ef2a7ad83ab30ae3325.tar.gz
cpython-ae9de82e321581e1906c6ef2a7ad83ab30ae3325.tar.bz2
bpo-46841: Use a `bytes` object for `_co_code_adaptive` (GH-32205)
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 987cdef..7d50b40 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -1523,8 +1523,8 @@ code_getfreevars(PyCodeObject *code, void *closure)
static PyObject *
code_getcodeadaptive(PyCodeObject *code, void *closure)
{
- return PyMemoryView_FromMemory(code->co_code_adaptive, _PyCode_NBYTES(code),
- PyBUF_READ);
+ return PyBytes_FromStringAndSize(code->co_code_adaptive,
+ _PyCode_NBYTES(code));
}
static PyObject *