File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1069,9 +1069,6 @@ public void run() {
1069
1069
}
1070
1070
}
1071
1071
1072
- // import polyglot decorators and special interop predefined behavior
1073
- loadFile (toTruffleStringUncached ("_polyglot" ), getContext ().getCoreHomeOrFail ());
1074
-
1075
1072
initialized = true ;
1076
1073
}
1077
1074
}
Original file line number Diff line number Diff line change 113
113
import com .oracle .graal .python .nodes .interop .InteropBehaviorMethod ;
114
114
import com .oracle .graal .python .nodes .interop .PForeignToPTypeNode ;
115
115
import com .oracle .graal .python .nodes .object .GetForeignObjectClassNode ;
116
+ import com .oracle .graal .python .nodes .statement .AbstractImportNode ;
116
117
import com .oracle .graal .python .nodes .truffle .PythonArithmeticTypes ;
117
118
import com .oracle .graal .python .nodes .util .CannotCastException ;
118
119
import com .oracle .graal .python .nodes .util .CastToJavaStringNode ;
@@ -161,6 +162,7 @@ public final class PolyglotModuleBuiltins extends PythonBuiltins {
161
162
private static final TruffleString T_MODIFIABLE = tsLiteral ("modifiable" );
162
163
private static final TruffleString T_INVOKABLE = tsLiteral ("invokable" );
163
164
private static final TruffleString T_INTERNAL = tsLiteral ("internal" );
165
+ private static final TruffleString T_INTERNAL_POLYGLOT_MODULE = tsLiteral ("_polyglot" );
164
166
165
167
@ Override
166
168
protected List <com .oracle .truffle .api .dsl .NodeFactory <? extends PythonBuiltinBaseNode >> getNodeFactories () {
@@ -189,6 +191,9 @@ public void postInitialize(Python3Core core) {
189
191
super .postInitialize (core );
190
192
191
193
GetForeignObjectClassNode .getUncached ().defineSingleTraitClasses ();
194
+
195
+ // import polyglot decorators which are defined in Python code
196
+ AbstractImportNode .importModule (T_INTERNAL_POLYGLOT_MODULE );
192
197
}
193
198
194
199
@ Builtin (name = "import_value" , minNumOfPositionalArgs = 1 , parameterNames = {"name" })
You can’t perform that action at this time.
0 commit comments