You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
__file__ value is lost when using different ScriptEngine instances in the same thread (v2.7.4b1) #327
ScriptEngineManager mgr = new ScriptEngineManager();
final String script = "print __file__\n";
for (int i=0; i<5; i++) {
ScriptEngine pyEngine = mgr.getEngineByName("jython");
pyEngine.put(ScriptEngine.FILENAME, "hello" + i +".py");
pyEngine.eval(script);
}
On any execution after the first I get errors with __file__ being undefined. This does not happen if I use a single ScriptEngine instance, or if each instance runs in a separate thread.
Activity