File tree Expand file tree Collapse file tree 5 files changed +12
-74
lines changed
com.oracle.graal.python/src/com/oracle/graal/python Expand file tree Collapse file tree 5 files changed +12
-74
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ protected CallTarget parse(ParsingRequest request) throws Exception {
241
241
if (!pythonCore .isInitialized ()) {
242
242
pythonCore .initialize ();
243
243
}
244
- pythonCore .runPostInit ();
244
+ pythonCore .loadBuiltinsPatches ();
245
245
context .getOrCreateMainModule (request .getSource ().getPath ());
246
246
247
247
// if we are running the interpreter, module 'site' is automatically imported
@@ -294,7 +294,7 @@ private void parseAndCache(PythonContext context) {
294
294
295
295
@ TruffleBoundary
296
296
private Object parseAndEval (PythonContext context , MaterializedFrame frame ) {
297
- context .getCore ().runPostInit ();
297
+ context .getCore ().loadBuiltinsPatches ();
298
298
PNode fragment = parseInline (source , context , frame );
299
299
return fragment .execute (frame );
300
300
}
Original file line number Diff line number Diff line change 29
29
import static com .oracle .graal .python .nodes .BuiltinNames .MODULE ;
30
30
import static com .oracle .graal .python .nodes .BuiltinNames .OBJECT ;
31
31
import static com .oracle .graal .python .nodes .BuiltinNames .TYPE ;
32
+ import static com .oracle .graal .python .nodes .BuiltinNames .__BUILTINS_PATCHES__ ;
32
33
import static com .oracle .graal .python .nodes .SpecialAttributeNames .__PACKAGE__ ;
33
34
34
35
import java .io .IOException ;
153
154
* {@link PythonContext} has its own core.
154
155
*/
155
156
public final class Python3Core implements PythonCore {
156
- private static final String POST_INIT_MODULE_NAME = "_post_init" ;
157
-
158
157
// Order matters!
159
158
private static final String [] CORE_FILES = new String []{
160
159
"_descriptor" ,
@@ -360,10 +359,10 @@ public void initialize() {
360
359
}
361
360
362
361
@ Override
363
- public void runPostInit () {
362
+ public void loadBuiltinsPatches () {
364
363
if (initialized ) {
365
364
String coreHome = PythonCore .getCoreHomeOrFail ();
366
- loadFile (POST_INIT_MODULE_NAME , coreHome );
365
+ loadFile (__BUILTINS_PATCHES__ , coreHome );
367
366
}
368
367
}
369
368
Original file line number Diff line number Diff line change 39
39
package com .oracle .graal .python .nodes ;
40
40
41
41
public abstract class BuiltinNames {
42
+ // graalpython internals
43
+ public static final String __BREAKPOINT__ = "__breakpoint__" ;
44
+ public static final String __BUILTINS_PATCHES__ = "__builtins_patches__" ;
45
+
46
+
47
+ // cpython internals
42
48
public static final String MODULE = "module" ;
43
49
public static final String __BUILD_CLASS__ = "__build_class__" ;
44
50
public static final String __MAIN__ = "__main__" ;
45
51
public static final String __BUILTINS__ = "__builtins__" ;
46
52
public static final String __DEBUG__ = "__debug__" ;
47
- public static final String __BREAKPOINT__ = "__breakpoint__" ;
48
53
49
54
// sys
50
55
public static final String EXCEPTHOOK = "excepthook" ;
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ public interface PythonCore {
123
123
124
124
public PythonContext getContext ();
125
125
126
- default void runPostInit () {
126
+ default void loadBuiltinsPatches () {
127
127
128
128
}
129
129
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments