File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -248,11 +248,8 @@ public static final class PythonThreadState {
248
248
TraceEvent tracingWhat ;
249
249
250
250
/*
251
- * tracks whether a contextVarsContext was ever set. This is useful to make bugs where
252
- * contextVarsContext gets set to null noticable.
251
+ * the current contextvars.Context for the thread.
253
252
*/
254
- boolean contextVarsContextInitialized = false ;
255
-
256
253
PContextVarsContext contextVarsContext ;
257
254
258
255
/*
@@ -339,16 +336,15 @@ public void setNativeWrapper(PThreadState nativeWrapper) {
339
336
}
340
337
341
338
public PContextVarsContext getContextVarsContext () {
342
- if (! contextVarsContextInitialized ) {
339
+ if (contextVarsContext == null ) {
343
340
contextVarsContext = PythonObjectFactory .getUncached ().createContextVarsContext ();
344
- contextVarsContextInitialized = true ;
345
341
}
346
342
return contextVarsContext ;
347
343
}
348
344
349
345
public void setContextVarsContext (PContextVarsContext contextVarsContext ) {
346
+ assert contextVarsContext != null ;
350
347
this .contextVarsContext = contextVarsContext ;
351
- this .contextVarsContextInitialized = true ;
352
348
}
353
349
354
350
public void dispose () {
You can’t perform that action at this time.
0 commit comments