From: Doug Evans Date: Thu, 8 Apr 2010 04:57:25 +0000 (+0000) Subject: * python/python.c (source_python_script): Use ensure_python_env X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eb5cda8649d496847e9ae93b06ec80a94a5edb84;p=binutils-gdb.git * python/python.c (source_python_script): Use ensure_python_env to prepare environment for script. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ccd52278139..f234f298176 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-04-07 Doug Evans + + * python/python.c (source_python_script): Use ensure_python_env + to prepare environment for script. + 2010-04-07 H.J. Lu * amd64-linux-nat.c: Include "regset.h", "elf/common.h", diff --git a/gdb/python/python.c b/gdb/python/python.c index 9a89eed142e..5ce4829b5f1 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -367,14 +367,14 @@ gdbpy_parse_and_eval (PyObject *self, PyObject *args) void source_python_script (FILE *stream, char *file) { - PyGILState_STATE state; + struct cleanup *cleanup; - state = PyGILState_Ensure (); + cleanup = ensure_python_env (get_current_arch (), current_language); PyRun_SimpleFile (stream, file); fclose (stream); - PyGILState_Release (state); + do_cleanups (cleanup); }