8000 bpo-1635741: port opcode module to multi-phase init (PEP 489) by koubaa · Pull Request #22050 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-1635741: port opcode module to multi-phase init (PEP 489) #22050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 7, 2020
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
Next Next commit
port _opcode to multi-phase
  • Loading branch information
koubaa committed Sep 1, 2020
commit dd28b6e65fd16825626dedb6af71eb0f745c19eb
28 changes: 16 additions & 12 deletions Modules/_opcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,34 @@ _opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg,
return effect;
}




static PyMethodDef
opcode_functions[] = {
_OPCODE_STACK_EFFECT_METHODDEF
{NULL, NULL, 0, NULL}
};

static int
_opcode_exec(PyObject *m)
{
return 0;
}

static PyModuleDef_Slot opcode_slots[] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list is now empty and so became useless. Please remove it.

{Py_mod_exec, _opcode_exec},
{0, NULL}
};

static struct PyModuleDef opcodemodule = {
PyModuleDef_HEAD_INIT,
"_opcode",
"Opcode support module.",
-1,
opcode_functions,
NULL,
NULL,
NULL,
NULL
.m_name = "_opcode",
.m_doc = "Opcode support module.",
.m_size = 0,
.m_methods = opcode_functions,
.m_slots = opcode_slots
};

PyMODINIT_FUNC
PyInit__opcode(void)
{
return PyModule_Create(&opcodemodule);
return PyModuleDef_Init(&opcodemodule);
}
0