From 569f364017442cc46e15e55027984ee890e2f8e2 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 18 Jul 2013 02:31:21 +0200 Subject: [PATCH] Issue #18408: Fix PyInit__curses_panel(), handle import_curses() failure Don't call PyErr_NewException() if an exception is set, or type_call() would fail with an assertion error. --- Modules/_curses_panel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c index 3e9fffd958..87b9c0516f 100644 --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -513,6 +513,8 @@ PyInit__curses_panel(void) goto fail; import_curses(); + if (PyErr_Occurred()) + goto fail; /* For exception _curses_panel.error */ _curses_panelstate(m)->PyCursesError = PyErr_NewException("_curses_panel.error", NULL, NULL); -- 2.50.1