Merge branch 'GP-7001_ryanmkurtz_pyghidra' (Closes #9288)

This commit is contained in:
Ryan Kurtz
2026-06-24 06:14:08 -04:00
3 changed files with 12 additions and 2 deletions

View File

@@ -99,8 +99,16 @@ public final class PyGhidraScriptProvider extends AbstractPythonScriptProvider {
implements PythonFieldExposer {
@Override
public void run() {
scriptRunner.accept(this);
public void run() throws Exception {
try {
scriptRunner.accept(this);
}
catch (Exception e) {
// This is a PyExceptionProxy, which we unfortunately cannot add a custom message
// to. We don't want to wrap it in a custom exception because then Python will lose
// access to the original BaseException.
throw e;
}
}
/**

View File

@@ -571,6 +571,7 @@ __3.2.0__
* PyGhidra's `help()` override can now show `public/private/protected` on Ghidra Java fields and
methods (available in Ghidra 12.2 and later).
* When an uncaught `JException` occurs, PyGhidra will now output the full Java stack trace.
* PyGhidra no longer swallows the original exception object generated by GhidraScripts.
__3.1.0__
* PyGhidra will now, by default, restore `sys.modules` to its prior state after a PyGhidra script is

View File

@@ -256,6 +256,7 @@ class PyGhidraScript(dict):
# pylint: disable=bare-except
except:
print_stacktrace(self._script, script_path)
raise
finally:
sys.argv = orig_argv