diff options
author | Doug Evans <dje@google.com> | 2010-04-08 04:57:23 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2010-04-08 04:57:23 +0000 |
commit | e684154fe996ce95eedbdb45cd344a32ba8d33de (patch) | |
tree | 55d420b98e0c2a2f4bba5a811aee98f9e1907a16 /gdb | |
parent | d130f0d0d3d7c678d9d0d90fd2611451042752e2 (diff) | |
download | gdb-e684154fe996ce95eedbdb45cd344a32ba8d33de.tar.gz |
* python/python.c (source_python_script): Use ensure_python_env
to prepare environment for script.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/python/python.c | 6 |
2 files changed, 8 insertions, 3 deletions
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 <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", 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); } |