File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,15 @@ def write(self, s):
5454 stdoutContextWriter = ScriptContextWriter (sys .stdout )
5555 sys .stdout = stdoutContextWriter
5656
57+ @JImplements ("java.util.function.Supplier" )
58+ class PythonObjectSupplier :
59+ def __init__ (self , obj ):
60+ self .obj = obj
61+
62+ @JOverride
63+ def get (self ):
64+ return self .obj
65+
5766 @JImplements ("java.util.function.Function" )
5867 class PythonScriptRunner :
5968 @JOverride
@@ -101,9 +110,10 @@ def apply(self, arg):
101110 try :
102111 arg .vars [key ] = to_java (script_locals [key ])
103112 except Exception :
104- error_writer = arg .scriptContext .getErrorWriter ()
105- if error_writer is not None :
106- error_writer .write (to_java (traceback .format_exc ()))
113+ arg .vars [key ] = PythonObjectSupplier (script_locals [key ])
114+ # error_writer = arg.scriptContext.getErrorWriter()
115+ # if error_writer is not None:
116+ # error_writer.write(to_java(traceback.format_exc()))
107117
108118 return to_java (return_value )
109119
You can’t perform that action at this time.
0 commit comments