Skip to content

Commit ac40c40

Browse files
committed
Fix adding __weakref__ slot
1 parent c8001c0 commit ac40c40

File tree

1 file changed

+3
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2088,7 +2088,9 @@ protected PythonClass typeMetaclass(VirtualFrame frame, TruffleString name, PTup
20882088
// takes care of checking if we may_add_dict and adds it if needed
20892089
addDictIfNative(frame, pythonClass, mro, getItemSize, writeItemSize);
20902090
addDictDescrAttribute(basesArray, pythonClass, factory);
2091-
addWeakrefDescrAttribute(pythonClass, factory);
2091+
if (mayAddWeakRef) {
2092+
addWeakrefDescrAttribute(pythonClass, factory);
2093+
}
20922094
} else {
20932095
// have slots
20942096
// Make it into a list

0 commit comments

Comments
 (0)