* python/python.c (source_python_script): Use ensure_python_env
authorDoug Evans <dje@google.com>
Thu, 8 Apr 2010 04:57:25 +0000 (04:57 +0000)
committerDoug Evans <dje@google.com>
Thu, 8 Apr 2010 04:57:25 +0000 (04:57 +0000)
to prepare environment for script.

gdb/ChangeLog
gdb/python/python.c

index ccd5227813937d2e6ce9d7ce87d0c8ca1da2440a..f234f2981760b32802981b1a4c07f83293bb796d 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-07  Doug Evans  <dje@google.com>
+
+       * python/python.c (source_python_script): Use ensure_python_env
+       to prepare environment for script.
+
 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        * amd64-linux-nat.c: Include "regset.h", "elf/common.h",
index 9a89eed142e6d0231eb108f718301b19b0225d6d..5ce4829b5f1896458242c676ba1055f73e66056b 100644 (file)
@@ -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);
 }
 
 \f