Skip to content

Commit 1237602

Browse files
committed
acquire the gil before printing parser warnings
1 parent 2204f26 commit 1237602

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,13 @@ protected CallTarget parse(ParsingRequest request) {
311311
}
312312
RootNode root = doParse(context, source, 0);
313313
if (root instanceof PRootNode) {
314-
((PRootNode) root).triggerDeprecationWarnings();
314+
GilNode gil = GilNode.getUncached();
315+
boolean wasAcquired = gil.acquire(context, root);
316+
try {
317+
((PRootNode) root).triggerDeprecationWarnings();
318+
} finally {
319+
gil.release(context, wasAcquired);
320+
}
315321
}
316322
if (core.isInitialized()) {
317323
return PythonUtils.getOrCreateCallTarget(new TopLevelExceptionHandler(this, root, source));

0 commit comments

Comments
 (0)