summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_code.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-06-13 23:14:00 (GMT)
committerGitHub <noreply@github.com>2025-06-13 23:14:00 (GMT)
commitf77a911c526442871ba66f01b31b8f497daf70eb (patch)
treef6a1ce32c1f7c955ed2dd5b63ed70431709bdb33 /Lib/test/test_code.py
parentd851f8e258c7328814943e923a7df81bca15df4b (diff)
downloadcpython-f77a911c526442871ba66f01b31b8f497daf70eb.zip
cpython-f77a911c526442871ba66f01b31b8f497daf70eb.tar.gz
cpython-f77a911c526442871ba66f01b31b8f497daf70eb.tar.bz2
[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>
Diffstat (limited to 'Lib/test/test_code.py')
-rw-r--r--Lib/test/test_code.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 9fc2b04..655f5a9 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -701,6 +701,7 @@ class CodeTest(unittest.TestCase):
'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 @@ class CodeTest(unittest.TestCase):
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,