bpo-42694: Prevent creating _curses_panel.panel (GH-23948)

Fix regression introduced in
commit 1baf030a902392fe92d934ed0fb6a385cf7d8869: restore removed code
to prevent creating a _curses_panel.panel instance directly.
This commit is contained in:
Victor Stinner 2020-12-26 02:17:46 +01:00 committed by GitHub
parent 4101018488
commit 993e88cf08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -654,6 +654,7 @@ _curses_panel_exec(PyObject *mod)
if (state->PyCursesPanel_Type == NULL) { if (state->PyCursesPanel_Type == NULL) {
return -1; return -1;
} }
((PyTypeObject *)state->PyCursesPanel_Type)->tp_new = NULL;
if (PyModule_AddType(mod, state->PyCursesPanel_Type) < 0) { if (PyModule_AddType(mod, state->PyCursesPanel_Type) < 0) {
return -1; return -1;