Skip to content

Commit cf8d43b

Browse files
committed
Unwrap Python strings to Java strings
1 parent 2a4d4dc commit cf8d43b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/scijava/plugins/scripting/jython/JythonScriptLanguage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
import org.python.core.PyNone;
3737
import org.python.core.PyObject;
38+
import org.python.core.PyString;
3839
import org.scijava.plugin.Plugin;
3940
import org.scijava.script.AdaptedScriptLanguage;
4041
import org.scijava.script.ScriptLanguage;
@@ -67,6 +68,9 @@ public Object decode(final Object object) {
6768
final Class<?> javaType = pyObj.getType().getProxyType();
6869
if (javaType != null) return pyObj.__tojava__(javaType);
6970
}
71+
if (object instanceof PyString) {
72+
return ((PyString) object).getString();
73+
}
7074
return object;
7175
}
7276

0 commit comments

Comments
 (0)