Fix Code.getargs() treating co_flags bitmask values as counts (#14493)
CO_VARARGS (4) and CO_VARKEYWORDS (8) are bitmask flags, but they were used directly as increment values for the argument count via `&`. This caused co_varnames[:argcount] to slice beyond the actual arguments when the function body contained enough local variables. Fix by wrapping the bitmask results in bool(), so they contribute at most 1 to the argcount. Closes #14492
E
EternalRights committed
f976bb67b293cf358e2fbd0352638e2f5a9da8e0
Parent: 4748bb1
Committed by GitHub <noreply@github.com>
on 5/30/2026, 11:49:42 AM