Skip to content

Commit

Permalink
bpo-46841: Use a bytes object for _co_code_adaptive (GH-32205)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher authored Apr 1, 2022
1 parent bd2e47c commit ae9de82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Objects/codeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down

0 comments on commit ae9de82

Please sign in to comment.