Skip to content

Commit a793fc6

Browse files
committed
Avoid string conversion in PosixException constructor
1 parent 8bd9e22 commit a793fc6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PosixSupportLibrary.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,6 @@ public static class PosixException extends Exception {
875875
private final TruffleString msg;
876876

877877
public PosixException(int errorCode, TruffleString message) {
878-
super(message.toJavaStringUncached());
879878
this.errorCode = errorCode;
880879
msg = message;
881880
}
@@ -884,6 +883,11 @@ public final TruffleString getMessageAsTruffleString() {
884883
return msg;
885884
}
886885

886+
@Override
887+
public String getMessage() {
888+
return msg.toJavaStringUncached();
889+
}
890+
887891
public int getErrorCode() {
888892
return errorCode;
889893
}

0 commit comments

Comments
 (0)