You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ctypes: array slice assignment replaces the value's __len__ exception with a ValueError #161840
Assigning a sequence to a slice of a ctypes array calls PySequence_Length on the value. When the value's __len__ raises, PySequence_Length returns -1 with the exception set, and the code reads the -1 as a length. The comparison -1 != slicelen is always true, so it raises its own ValueError("Can only assign sequence of same size") over the pending exception, which replaces it.
Expected: the exception from __len__ should propagate.
Activity