]> granicus.if.org Git - python/commitdiff
Issue #18408: Fix PyInit__curses_panel(), handle import_curses() failure
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 18 Jul 2013 00:31:21 +0000 (02:31 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 18 Jul 2013 00:31:21 +0000 (02:31 +0200)
Don't call PyErr_NewException() if an exception is set, or type_call() would
fail with an assertion error.

Modules/_curses_panel.c

index 3e9fffd9587e6592226a68d9fabb886bcf813d5d..87b9c0516f4add59697bb9a521aeb59e0941eb0a 100644 (file)
@@ -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);