mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-1099: Supporting the __file__ attribute in Jython scripts
This commit is contained in:
@@ -211,6 +211,9 @@ public class GhidraPythonInterpreter extends InteractiveInterpreter {
|
||||
|
||||
Py.getThreadState().tracefunc = interruptTraceFunction;
|
||||
|
||||
// The Python import system sets the __file__ attribute to the file it's executing
|
||||
setVariable("__file__", new PyString(file.getAbsolutePath()));
|
||||
|
||||
// If the remote python debugger is alive, initialize it by calling settrace()
|
||||
if (!SystemUtilities.isInDevelopmentMode() && !SystemUtilities.isInHeadlessMode()) {
|
||||
if (PyDevUtils.getPyDevSrcDir() != null) {
|
||||
|
||||
Reference in New Issue
Block a user