diff options
Diffstat (limited to 'gdb/cli/cli-cmds.c')
-rw-r--r-- | gdb/cli/cli-cmds.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 52a6bc9..73e03cf 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -525,27 +525,15 @@ source_script_from_stream (FILE *stream, const char *file) if (script_ext_mode != script_ext_off && strlen (file) > 3 && !strcmp (&file[strlen (file) - 3], ".py")) { - volatile struct gdb_exception e; - - TRY_CATCH (e, RETURN_MASK_ERROR) + if (have_python ()) + source_python_script (stream, file); + else if (script_ext_mode == script_ext_soft) { - source_python_script (stream, file); - } - if (e.reason < 0) - { - /* Should we fallback to ye olde GDB script mode? */ - if (script_ext_mode == script_ext_soft - && e.reason == RETURN_ERROR && e.error == UNSUPPORTED_ERROR) - { - fseek (stream, 0, SEEK_SET); - script_from_file (stream, (char*) file); - } - else - { - /* Nope, just punt. */ - throw_exception (e); - } + /* Fallback to GDB script mode. */ + script_from_file (stream, file); } + else + error (_("Python scripting is not supported in this copy of GDB.")); } else script_from_file (stream, file); |