diff options
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r-- | gdb/python/python.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |