From eb5cda8649d496847e9ae93b06ec80a94a5edb84 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 8 Apr 2010 04:57:25 +0000 Subject: * python/python.c (source_python_script): Use ensure_python_env to prepare environment for script. --- gdb/python/python.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/python/python.c') diff --git a/gdb/python/python.c b/gdb/python/python.c index 9a89eed..5ce4829 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); } -- cgit v1.1