Skip to content

Commit 9bb75e0

Browse files
committed
Turn redundant isNativeAccessAllowed check into assertion
1 parent 4ccacec commit 9bb75e0

File tree

1 file changed

+2
-3
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/jni

1 file changed

+2
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/jni/GraalHPyJNIContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,8 @@ long getHPyDebugContext() {
449449
@Override
450450
@TruffleBoundary
451451
public PythonModule getHPyDebugModule() throws ImportException {
452-
if (!getContext().getEnv().isNativeAccessAllowed() || getContext().getLanguage().getEngineOption(PythonOptions.HPyBackend) != HPyBackendMode.JNI) {
453-
throw new ImportException(null, null, null, ErrorMessages.HPY_DEBUG_MODE_NOT_AVAILABLE);
454-
}
452+
assert getContext().getEnv().isNativeAccessAllowed();
453+
assert getContext().getLanguage().getEngineOption(PythonOptions.HPyBackend) == HPyBackendMode.JNI;
455454

456455
// force the universal context to native; we need a real pointer for JNI
457456
try {

0 commit comments

Comments
 (0)