diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2025-04-11 04:13:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-11 04:13:26 (GMT) |
commit | 07b8d3117fdbc4e5be55aab0be428c278ec84e12 (patch) | |
tree | 31f37f65b1ebe9553f577586ba42e27588d22292 /Python/codegen.c | |
parent | e5f68fd29b3bd867207f23608a8dbc5759a056ed (diff) | |
download | cpython-07b8d3117fdbc4e5be55aab0be428c278ec84e12.zip cpython-07b8d3117fdbc4e5be55aab0be428c278ec84e12.tar.gz cpython-07b8d3117fdbc4e5be55aab0be428c278ec84e12.tar.bz2 |
gh-132261: Store annotations at hidden internal keys in the class dict (#132345)
Diffstat (limited to 'Python/codegen.c')
-rw-r--r-- | Python/codegen.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/codegen.c b/Python/codegen.c index dc50737..379d37c 100644 --- a/Python/codegen.c +++ b/Python/codegen.c @@ -815,7 +815,10 @@ codegen_process_deferred_annotations(compiler *c, location loc) Py_DECREF(conditional_annotation_indices); RETURN_IF_ERROR(codegen_leave_annotations_scope(c, loc)); - RETURN_IF_ERROR(codegen_nameop(c, loc, &_Py_ID(__annotate__), Store)); + RETURN_IF_ERROR(codegen_nameop( + c, loc, + ste->ste_type == ClassBlock ? &_Py_ID(__annotate_func__) : &_Py_ID(__annotate__), + Store)); return SUCCESS; error: |