Skip to content

Commit fae2db3

Browse files
committed
minor cleanup - extract err msg to ErrorMessages
1 parent 3fcc66a commit fae2db3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/ErrorMessages.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public abstract class ErrorMessages {
132132
public static final String CANNOT_DELETE_MEMORY = "cannot delete memory";
133133
public static final String CANNOT_MODIFY_READONLY_MEMORY = "cannot modify read-only memory";
134134
public static final String CANNOT_EXTEND_INCOMPLETE_P = "Cannot extend an incomplete type '%p'";
135+
public static final String CANNOT_FIT_P_INTO_INDEXSIZED_INT = "cannot fit '%p' into an index-sized integer";
135136
public static final String CANNOT_GET_SHAPE_OF_NATIVE_CLS = "cannot get shape of native class";
136137
public static final String CANNOT_GET_CONSISTEMT_METHOD_RESOLUTION = "Cannot create a consistent method resolution\norder (MRO) for bases %s";
137138
public static final String CANNOT_HANDLE_ZIP_FILE = "cannot handle Zip file: '%s'";

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/PRaiseNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public final PException raise(PythonBuiltinClassType type, Exception e) {
8686
* specified {@code type} as exception class.
8787
*/
8888
public final PException raiseNumberTooLarge(Object type, Object result) {
89-
return execute(type, PNone.NO_VALUE, "cannot fit '%p' into an index-sized integer", new Object[]{result});
89+
return execute(type, PNone.NO_VALUE, ErrorMessages.CANNOT_FIT_P_INTO_INDEXSIZED_INT, new Object[]{result});
9090
}
9191

9292
public final PException raiseHasNoLength(Object result) {

0 commit comments

Comments
 (0)