summaryrefslogtreecommitdiffstats
path: root/Lib/test/_code_definitions.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/_code_definitions.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/_code_definitions.py')
-rw-r--r--Lib/test/_code_definitions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/_code_definitions.py b/Lib/test/_code_definitions.py
index 274beb6..70c44da 100644
--- a/Lib/test/_code_definitions.py
+++ b/Lib/test/_code_definitions.py
@@ -57,6 +57,13 @@ def spam_with_globals_and_builtins():
print(res)
+def spam_with_global_and_attr_same_name():
+ try:
+ spam_minimal.spam_minimal
+ except AttributeError:
+ pass
+
+
def spam_full_args(a, b, /, c, d, *args, e, f, **kwargs):
return (a, b, c, d, e, f, args, kwargs)
@@ -190,6 +197,7 @@ TOP_FUNCTIONS = [
spam_minimal,
spam_with_builtins,
spam_with_globals_and_builtins,
+ spam_with_global_and_attr_same_name,
spam_full_args,
spam_full_args_with_defaults,
spam_args_attrs_and_builtins,
@@ -258,6 +266,7 @@ STATELESS_CODE = [
script_with_globals,
spam_full_args_with_defaults,
spam_with_globals_and_builtins,
+ spam_with_global_and_attr_same_name,
spam_full,
]
@@ -275,6 +284,7 @@ SCRIPT_FUNCTIONS = [
*PURE_SCRIPT_FUNCTIONS,
script_with_globals,
spam_with_globals_and_builtins,
+ spam_with_global_and_attr_same_name,
]