[Python-checkins] bpo-42694: Prevent creating _curses_panel.panel (GH-23948)

vstinner webhook-mailer at python.org
Fri Dec 25 20:18:05 EST 2020


https://github.com/python/cpython/commit/993e88cf08994f7c1e0f9f62fda4ed32634ee2ad
commit: 993e88cf08994f7c1e0f9f62fda4ed32634ee2ad
branch: master
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2020-12-26T02:17:46+01:00
summary:

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.

files:
M Modules/_curses_panel.c

diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index 7d252244e2405..d782ccd086798 100644
--- a/Modules/_curses_panel.c
+++ b/Modules/_curses_panel.c
@@ -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;
@@ -715,4 +716,4 @@ PyMODINIT_FUNC
 PyInit__curses_panel(void)
 {
     return PyModuleDef_Init(&_curses_panelmodule);
-}
\ No newline at end of file
+}



More information about the Python-checkins mailing list