Skip to content

Commit 7336e02

Browse files
committed
Fix: return NULL handle for NoValue
1 parent 18286e4 commit 7336e02

File tree

1 file changed

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

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,9 @@ public long ctxContextVarGet(long varBits, long defBits, long errBits) {
23562356
PythonLanguage lang = ctx.getLanguage();
23572357
Object def = getObjectForHPyHandle(GraalHPyBoxing.unboxHandle(defBits));
23582358
Object res = GraalHPyContextVarGet.getObject(ctx.getThreadState(lang), (PContextVar) var, def);
2359+
if (res == GraalHPyHandle.NULL_HANDLE_DELEGATE) {
2360+
return 0;
2361+
}
23592362
return GraalHPyBoxing.boxHandle(getHPyHandleForObject(res));
23602363
}
23612364

0 commit comments

Comments
 (0)