[3.14] gh-135437: Account For Duplicate Names in _PyCode_SetUnboundVarCounts() (gh-135493)

(cherry picked from commit 56eabea, AKA gh-135438)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-06-14 01:14:00 +02:00 committed by GitHub
parent d851f8e258
commit f77a911c52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 40 additions and 5 deletions

View file

@ -701,6 +701,7 @@ def test_local_kinds(self):
'checks': CO_FAST_LOCAL,
'res': CO_FAST_LOCAL,
},
defs.spam_with_global_and_attr_same_name: {},
defs.spam_full_args: {
'a': POSONLY,
'b': POSONLY,
@ -955,6 +956,10 @@ def new_var_counts(*,
purelocals=5,
globalvars=6,
),
defs.spam_with_global_and_attr_same_name: new_var_counts(
globalvars=2,
attrs=1,
),
defs.spam_full_args: new_var_counts(
posonly=2,
posorkw=2,