Skip to content

Commit

Permalink
bpo-42694: Prevent creating _curses_panel.panel (GH-23948)
Browse files Browse the repository at this point in the history
Fix regression introduced in
commit 1baf030: restore removed code
to prevent creating a _curses_panel.panel instance directly.
  • Loading branch information
vstinner committed Dec 26, 2020
1 parent 4101018 commit 993e88c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Modules/_curses_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ _curses_panel_exec(PyObject *mod)
if (state->PyCursesPanel_Type == NULL) {
return -1;
}
((PyTypeObject *)state->PyCursesPanel_Type)->tp_new = NULL;

if (PyModule_AddType(mod, state->PyCursesPanel_Type) < 0) {
return -1;
Expand Down Expand Up @@ -715,4 +716,4 @@ PyMODINIT_FUNC
PyInit__curses_panel(void)
{
return PyModuleDef_Init(&_curses_panelmodule);
}
}

0 comments on commit 993e88c

Please sign in to comment.