* python/python.c (source_python_script): Use ensure_python_env
to prepare environment for script.
This commit is contained in:
parent
9957b18fba
commit
eb5cda8649
2 changed files with 8 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue