Skip to content

Commit 5a8abd8

Browse files
committed
Pass MroSequenceStorage to DynamicObjectStorage when getting type.__dict__
1 parent d17af8b commit 5a8abd8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type/TypeBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ Object doManaged(PythonManagedClass self,
695695
@CachedLibrary("self") PythonObjectLibrary lib) {
696696
PDict dict = lib.getDict(self);
697697
if (dict == null) {
698-
dict = factory().createDictFixedStorage(self);
698+
dict = factory().createDictFixedStorage(self, self.getMethodResolutionOrder());
699699
// The mapping is unmodifiable, so we don't have to assign it back
700700
}
701701
return factory().createMappingproxy(dict);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/object/PythonObjectFactory.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
import com.oracle.graal.python.runtime.sequence.storage.EmptySequenceStorage;
136136
import com.oracle.graal.python.runtime.sequence.storage.IntSequenceStorage;
137137
import com.oracle.graal.python.runtime.sequence.storage.LongSequenceStorage;
138+
import com.oracle.graal.python.runtime.sequence.storage.MroSequenceStorage;
138139
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage;
139140
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorageFactory;
140141
import com.oracle.graal.python.util.PythonUtils;
@@ -204,7 +205,7 @@ protected static AllocationReporter getAllocationReporter(ContextReference<Pytho
204205
return contextRef.get().getEnv().lookup(AllocationReporter.class);
205206
}
206207

207-
private final PythonLanguage getLanguage() {
208+
private PythonLanguage getLanguage() {
208209
return executeGetLanguage(true, 0.0);
209210
}
210211

@@ -556,6 +557,10 @@ public PDict createDict(DynamicObject dynamicObject) {
556557
return createDict(new DynamicObjectStorage(dynamicObject));
557558
}
558559

560+
public PDict createDictFixedStorage(PythonObject pythonObject, MroSequenceStorage mroSequenceStorage) {
561+
return createDict(new DynamicObjectStorage(pythonObject.getStorage(), mroSequenceStorage));
562+
}
563+
559564
public PDict createDictFixedStorage(PythonObject pythonObject) {
560565
return createDict(new DynamicObjectStorage(pythonObject.getStorage()));
561566
}

0 commit comments

Comments
 (0)