diff options
Diffstat (limited to 'gdb/python/python-prettyprint.c')
-rw-r--r-- | gdb/python/python-prettyprint.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gdb/python/python-prettyprint.c b/gdb/python/python-prettyprint.c index 09ef261..57e517a 100644 --- a/gdb/python/python-prettyprint.c +++ b/gdb/python/python-prettyprint.c @@ -474,10 +474,8 @@ apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, char *hint = NULL; struct cleanup *cleanups; int result = 0; - PyGILState_STATE state; - state = PyGILState_Ensure (); - cleanups = make_cleanup_py_restore_gil (&state); + cleanups = ensure_python_env (gdbarch, language); /* Instantiate the printer. */ if (valaddr) @@ -526,13 +524,11 @@ apply_varobj_pretty_printer (PyObject *printer_obj, struct value **replacement) { char *result; - PyGILState_STATE state = PyGILState_Ensure (); *replacement = NULL; result = pretty_print_one_value (printer_obj, replacement); if (result == NULL); gdbpy_print_stack (); - PyGILState_Release (state); return result; } |