Repository navigation
Vector{2,3}.__delattr__ messaging fixed when deleting x, y, {z} and removed Vector4 zombies - #3069
Conversation
…and removed Vector4 zombie remnants
| break; | ||
| } | ||
| case 2: { | ||
| if (self->dim >= 3) { |
There was a problem hiding this comment.
Why is this check needed? I think in this path an error should be raised either way regardless of dim value
There was a problem hiding this comment.
Differentiate between vector2 and vector3. This also guarantees the old behavior of going to badinternalcall if somehow someone manages to get a vec2 with a z property
There was a problem hiding this comment.
The old code checked for
if (component >= self->dim) {
PyErr_BadInternalCall();
}Irrespective of the status of value but the changes do not preserve this behaviour.
There was a problem hiding this comment.
Your latest commit didn't address what I was trying to say.
Consider a call where value != NULL && component >= self->dim. In this case the old code correctly raises an error but the new code doesn't. The PyErr_BadInternalCall check should happen independently of the NULL check outside the block and above it.
MyreMylar
left a comment
There was a problem hiding this comment.
OK, LGTM. The code makes sense and I can verify that the new tests fail before this PR is compiled and pass afterwards (tested locally).
Fixes #3066 and removes the remnants of whatever Vector4 used to be there