Skip to content

Commit 59c1d9b

Browse files
author
Adam Hrbac
committed
Pass a node to PythonLanguage.get
This allows it to be inlined in compiled code
1 parent 4db0a17 commit 59c1d9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3756,7 +3756,7 @@ int execute(Object[] arguments,
37563756
if (!(var instanceof PContextVar)) {
37573757
throw raiseNode.raise(TypeError, ErrorMessages.INSTANCE_OF_CONTEXTVAR_EXPECTED);
37583758
}
3759-
PythonContext.PythonThreadState threadState = context.getContext().getThreadState(PythonLanguage.get(null));
3759+
PythonContext.PythonThreadState threadState = context.getContext().getThreadState(PythonLanguage.get(asContextNode));
37603760
Object result = ((PContextVar) var).getValue(threadState);
37613761
if (result == null) {
37623762
if (def == NULL_HANDLE_DELEGATE) {
@@ -3802,7 +3802,7 @@ Object execute(Object[] arguments,
38023802
if (!(var instanceof PContextVar)) {
38033803
throw raiseNode.raise(TypeError, ErrorMessages.INSTANCE_OF_CONTEXTVAR_EXPECTED);
38043804
}
3805-
PythonContext.PythonThreadState threadState = context.getContext().getThreadState(PythonLanguage.get(null));
3805+
PythonContext.PythonThreadState threadState = context.getContext().getThreadState(PythonLanguage.get(asContextNode));
38063806
((PContextVar) var).setValue(threadState, val);
38073807
return asHandleNode.execute(context, PNone.NONE);
38083808
} catch (PException e) {

0 commit comments

Comments
 (0)