Skip to content

Commit db6bff2

Browse files
committed
Move constant HPY_LOAD_ERROR to ErrorMessages.
1 parent 0031c0c commit db6bff2

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ImpModuleBuiltins.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,6 @@ private Object initCApiModule(TruffleObject sulongLibrary, String initFuncName,
318318
}
319319
}
320320

321-
private static final String CAPI_LOAD_ERROR = "Could not load C API from %s.\n";
322-
private static final String HPY_LOAD_ERROR = "Could not load HPy C API from %s.\n";
323-
324321
@TruffleBoundary
325322
private void ensureCapiWasLoaded() {
326323
PythonContext context = getContext();
@@ -387,7 +384,7 @@ private GraalHPyContext ensureHPyWasLoaded(PythonContext context) {
387384
interopLibrary.invokeMember(hpyLibrary, "graal_hpy_init", new GraalHPyInitObject(context.getHPyContext()));
388385
} catch (IOException | RuntimeException | InteropException e) {
389386
logJavaException(e);
390-
throw raise(ImportError, wrapJavaException(e), HPY_LOAD_ERROR, capiFile.getAbsoluteFile().getPath());
387+
throw raise(ImportError, wrapJavaException(e), ErrorMessages.HPY_LOAD_ERROR, capiFile.getAbsoluteFile().getPath());
391388
}
392389
}
393390
return context.getHPyContext();

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,5 +523,6 @@ public abstract class ErrorMessages {
523523
public static final String PRECISION_NOT_ALLOWED_FOR_INT = "Precision not allowed in integer format specifier";
524524
public static final String SIGN_NOT_ALLOWED_WITH_C_FOR_INT = "Sign not allowed with integer format specifier 'c'";
525525
public static final String CAPI_LOAD_ERROR = "Could not load C API from %s.";
526-
public static final String NATIVE_ACCESS_NOT_ALLOWED = "Cannot run any C extensions because native access is not allowed.\n";
526+
public static final String NATIVE_ACCESS_NOT_ALLOWED = "Cannot run any C extensions because native access is not allowed.";
527+
public static final String HPY_LOAD_ERROR = "Could not load HPy C API from %s.";
527528
}

0 commit comments

Comments
 (0)