bpo-46841: Use a `bytes` object for `_co_code_adaptive` (GH-32205)

This commit is contained in:
Brandt Bucher 2022-04-01 04:28:50 -07:00 committed by GitHub
parent bd2e47c883
commit ae9de82e32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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 *