From 2195f16f6e7c0ba14bb0b04fab98c1b416bfd14d Mon Sep 17 00:00:00 2001 From: Sven Trenkel Date: Mon, 3 May 2010 15:01:56 +0200 Subject: [PATCH] python: Fixed a crash if the plugin was loaded but not configured. --- src/python.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/python.c b/src/python.c index d750d95b..7a92b485 100644 --- a/src/python.c +++ b/src/python.c @@ -828,6 +828,11 @@ static int cpy_init(void) { static pthread_t thread; sigset_t sigset; + if (!Py_IsInitialized()) { + WARNING("python: Plugin loaded but not configured."); + plugin_unregister_shutdown("python"); + return 0; + } PyEval_InitThreads(); /* Now it's finally OK to use python threads. */ for (c = cpy_init_callbacks; c; c = c->next) { -- 2.11.0