Skip to content

Commit c4556eb

Browse files
committed
run post init hooks on inline parse requests as well
1 parent 6871c15 commit c4556eb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ private void parseAndCache(PythonContext context) {
294294

295295
@TruffleBoundary
296296
private Object parseAndEval(PythonContext context, MaterializedFrame frame) {
297+
context.getCore().runPostInit();
297298
PNode fragment = parseInline(source, context, frame);
298299
return fragment.execute(frame);
299300
}
@@ -303,7 +304,8 @@ private Object parseAndEval(PythonContext context, MaterializedFrame frame) {
303304

304305
@TruffleBoundary
305306
protected static PNode parseInline(Source code, PythonContext context, MaterializedFrame lexicalContextFrame) {
306-
return context.getCore().getParser().parseInline(context.getCore(), code, lexicalContextFrame);
307+
PythonCore pythonCore = context.getCore();
308+
return pythonCore.getParser().parseInline(pythonCore, code, lexicalContextFrame);
307309
}
308310

309311
@Override

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/Python3Core.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public void runPostInit() {
364364
if (initialized) {
365365
String coreHome = PythonCore.getCoreHomeOrFail();
366366
loadFile(POST_INIT_MODULE_NAME, coreHome);
367-
}
367+
}
368368
}
369369

370370
public Object duplicate(Map<Object, Object> replacements, Object value) {

0 commit comments

Comments
 (0)