Skip to content

Commit da8bd0a

Browse files
committed
load builtin patches sooner
1 parent 4320d2c commit da8bd0a

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ public final class Python3Core implements PythonCore {
288288
private final PythonParser parser;
289289

290290
@CompilationFinal private boolean initialized;
291-
@CompilationFinal private boolean builtinsPatchesLoaded;
292291

293292
// used in case PythonOptions.SharedCore is false
294293
@CompilationFinal private PythonContext singletonContext;
@@ -356,18 +355,10 @@ public void initialize() {
356355
}
357356
exportCInterface(getContext());
358357
currentException = null;
358+
loadFile(__BUILTINS_PATCHES__, PythonCore.getCoreHomeOrFail());
359359
initialized = true;
360360
}
361361

362-
@Override
363-
public void loadBuiltinsPatches() {
364-
if (initialized && !builtinsPatchesLoaded) {
365-
builtinsPatchesLoaded = true;
366-
String coreHome = PythonCore.getCoreHomeOrFail();
367-
loadFile(__BUILTINS_PATCHES__, coreHome);
368-
}
369-
}
370-
371362
public Object duplicate(Map<Object, Object> replacements, Object value) {
372363
Object replacement = replacements.get(value);
373364
if (replacement != null) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/PythonParserImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ public Node parse(ParserMode mode, PythonCore core, Source source, Frame current
9292
throw handleParserError(core, source, e);
9393
}
9494
}
95-
// ensure builtins patches are loaded before parsing
96-
core.loadBuiltinsPatches();
9795
TranslationEnvironment environment = new TranslationEnvironment(core.getLanguage());
9896
Node result;
9997
Consumer<TranslationEnvironment> environmentConsumer = (env) -> env.setFreeVarsInRootScope(currentFrame);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonCore.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ public interface PythonCore {
121121

122122
public PythonContext getContext();
123123

124-
default void loadBuiltinsPatches() {
125-
126-
}
127-
128124
static void writeWarning(TruffleLanguage.Env env, String warning) {
129125
if (!LIBPOLYGLOT || env.getOptions().get(PythonOptions.VerboseFlag)) {
130126
write(env, "WARNING: " + warning);

0 commit comments

Comments
 (0)