Commit 5526045b authored by Morten Welinder's avatar Morten Welinder

More python breakage.

parent 58390be1
...@@ -14,8 +14,8 @@ Jukka: ...@@ -14,8 +14,8 @@ Jukka:
Morten: Morten:
* Speed up font handling a bit. * Speed up font handling a bit.
* Speed up dependency handling. * Speed up dependency handling.
* Fix the python loader. (Work around mind-boggling bug in * Fix the python and python-loader modules. (Work around mind-
python. Again.) boggling bug in python. Again.)
Zbigniew: Zbigniew:
* Support for translations in plugin.xml files using xml-i18n-tools * Support for translations in plugin.xml files using xml-i18n-tools
......
2001-08-28 Morten Welinder <terra@diku.dk>
* python.c (plugin_init_general): Avoid segfaults with buggy pythons.
2001-08-21 Zbigniew Chyla <cyba@gnome.pl> 2001-08-21 Zbigniew Chyla <cyba@gnome.pl>
* plugin.xml: Removed * plugin.xml: Removed
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "Python.h" #include "Python.h"
#define BROKEN_PY_INITIALIZE
GNUMERIC_MODULE_PLUGIN_INFO_DECL; GNUMERIC_MODULE_PLUGIN_INFO_DECL;
/* Classes we define in Python code, and where we define them. */ /* Classes we define in Python code, and where we define them. */
...@@ -887,11 +889,25 @@ plugin_cleanup_general (ErrorInfo **ret_error) ...@@ -887,11 +889,25 @@ plugin_cleanup_general (ErrorInfo **ret_error)
*ret_error = NULL; *ret_error = NULL;
} }
#ifdef BROKEN_PY_INITIALIZE
extern char **environ;
#endif
void void
plugin_init_general (ErrorInfo **ret_error) plugin_init_general (ErrorInfo **ret_error)
{ {
gchar *exc_string; gchar *exc_string;
#ifdef BROKEN_PY_INITIALIZE
int i;
/* Python's convertenviron has gotten into its head that it can
write to the strings in the environment. We have little choice
but to allocate a copy of everything. */
for (i = 0; environ[i]; i++)
environ[i] = g_strdup (environ[i]);
#endif
*ret_error = NULL; *ret_error = NULL;
/* initialize the python interpreter */ /* initialize the python interpreter */
Py_SetProgramName ("gnumeric"); Py_SetProgramName ("gnumeric");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment