Skip to content

Commit 041cb87

Browse files
committed
Fix creating native timedelta subclass instances
1 parent 527e4da commit 041cb87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,8 +1122,8 @@ static Object addInheritedSlots(PythonAbstractNativeObject pythonClass,
11221122
int flags = readI32.readStructArrayElement(member, i, PyMemberDef__flags);
11231123
Object docPtr = readPointer.readStructArrayElement(member, i, PyMemberDef__doc);
11241124
Object doc = PGuards.isNullOrZero(docPtr, lib) ? PNone.NO_VALUE : fromCharPointer.execute(docPtr);
1125-
1126-
addMember.execute(pythonClass, dict, name, type, offset, flags & CConstants.READONLY.intValue(), doc);
1125+
boolean canSet = (flags & CConstants.READONLY.intValue()) == 0;
1126+
addMember.execute(pythonClass, dict, name, type, offset, canSet ? 1 : 0, doc);
11271127
}
11281128
}
11291129
}

0 commit comments

Comments
 (0)