summaryrefslogtreecommitdiffstats
path: root/Modules/_curses_panel.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-08 17:46:22 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-08 17:46:22 (GMT)
commite3f1b0911e02f5108b90b9b25417a448a423da40 (patch)
treea9f0a153bfdbe33f242c3dcbcb25f6b2d31afe8e /Modules/_curses_panel.c
parent4c35964b764540988bfb342bffc7c4b1cb674031 (diff)
downloadcpython-e3f1b0911e02f5108b90b9b25417a448a423da40.zip
cpython-e3f1b0911e02f5108b90b9b25417a448a423da40.tar.gz
cpython-e3f1b0911e02f5108b90b9b25417a448a423da40.tar.bz2
Issue #23815: Fixed crashes related to directly created instances of types in
_tkinter and curses.panel modules.
Diffstat (limited to 'Modules/_curses_panel.c')
-rw-r--r--Modules/_curses_panel.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index 759b731..c77e614 100644
--- a/Modules/_curses_panel.c
+++ b/Modules/_curses_panel.c
@@ -506,10 +506,11 @@ PyInit__curses_panel(void)
d = PyModule_GetDict(m);
/* Initialize object type */
- _curses_panelstate(m)->PyCursesPanel_Type = \
- PyType_FromSpec(&PyCursesPanel_Type_spec);
- if (_curses_panelstate(m)->PyCursesPanel_Type == NULL)
+ v = PyType_FromSpec(&PyCursesPanel_Type_spec);
+ if (v == NULL)
goto fail;
+ ((PyTypeObject *)v)->tp_new = NULL;
+ _curses_panelstate(m)->PyCursesPanel_Type = v;
import_curses();
if (PyErr_Occurred())