File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -194,13 +194,19 @@ public enum PythonBuiltinClassType implements LazyPythonClass {
194
194
private final String name ;
195
195
private final Shape instanceShape ;
196
196
private final String publicInModule ;
197
+ private final String qualifiedName ;
197
198
198
199
// initialized in static constructor
199
200
@ CompilationFinal private PythonBuiltinClassType base ;
200
201
201
202
PythonBuiltinClassType (String name , String publicInModule ) {
202
203
this .name = name ;
203
204
this .publicInModule = publicInModule ;
205
+ if (publicInModule != null && publicInModule != BuiltinNames .BUILTINS ) {
206
+ qualifiedName = publicInModule + "." + name ;
207
+ } else {
208
+ qualifiedName = name ;
209
+ }
204
210
this .instanceShape = com .oracle .graal .python .builtins .objects .object .PythonObject .freshShape (this );
205
211
}
206
212
@@ -213,6 +219,10 @@ public String getName() {
213
219
return name ;
214
220
}
215
221
222
+ public String getQualifiedName () {
223
+ return qualifiedName ;
224
+ }
225
+
216
226
public PythonBuiltinClassType getBase () {
217
227
return base ;
218
228
}
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public final class PythonBuiltinClass extends PythonManagedClass {
39
39
private final PythonBuiltinClassType type ;
40
40
41
41
public PythonBuiltinClass (PythonBuiltinClassType builtinClass , PythonAbstractClass base ) {
42
- super (PythonBuiltinClassType .PythonClass , builtinClass .getName (), base );
42
+ super (PythonBuiltinClassType .PythonClass , builtinClass .getQualifiedName (), base );
43
43
this .type = builtinClass ;
44
44
}
45
45
Original file line number Diff line number Diff line change 76
76
import com .oracle .graal .python .builtins .objects .mappingproxy .PMappingproxy ;
77
77
import com .oracle .graal .python .builtins .objects .object .PythonObject ;
78
78
import com .oracle .graal .python .builtins .objects .object .PythonObjectLibrary ;
79
+ import com .oracle .graal .python .builtins .objects .type .TypeBuiltinsFactory .CallNodeFactory ;
79
80
import com .oracle .graal .python .builtins .objects .type .TypeNodes .GetMroNode ;
80
81
import com .oracle .graal .python .builtins .objects .type .TypeNodes .GetSubclassesNode ;
81
- import com .oracle .graal .python .builtins .objects .type .TypeBuiltinsFactory .CallNodeFactory ;
82
82
import com .oracle .graal .python .builtins .objects .type .TypeNodesFactory .IsSameTypeNodeGen ;
83
83
import com .oracle .graal .python .nodes .BuiltinNames ;
84
84
import com .oracle .graal .python .nodes .PGuards ;
@@ -809,7 +809,7 @@ private static Object getModuleName(String fqname) {
809
809
abstract static class QualNameNode extends AbstractSlotNode {
810
810
@ Specialization (guards = "isNoValue(value)" )
811
811
String getName (PythonBuiltinClassType cls , @ SuppressWarnings ("unused" ) PNone value ) {
812
- return cls .getName ();
812
+ return cls .getQualifiedName ();
813
813
}
814
814
815
815
@ Specialization (guards = "isNoValue(value)" )
You can’t perform that action at this time.
0 commit comments