mirror of
https://github.com/python/cpython.git
synced 2026-06-28 11:50:50 +00:00
[3.15] gh-149805: Fix SystemError when compiling __classdict__ class annotation (GH-149806)
(cherry picked from commit c52d2b16dd)
Co-authored-by: Stan Ulbrych <stan@python.org>
This commit is contained in:
parent
accc0c8315
commit
f8cea98b4e
3 changed files with 10 additions and 0 deletions
|
|
@ -2870,6 +2870,7 @@ symtable_visit_annotation(struct symtable *st, expr_ty annotation, void *key)
|
|||
int future_annotations = st->st_future->ff_features & CO_FUTURE_ANNOTATIONS;
|
||||
if (current_type == ClassBlock && !future_annotations) {
|
||||
st->st_cur->ste_can_see_class_scope = 1;
|
||||
parent_ste->ste_needs_classdict = 1;
|
||||
if (!symtable_add_def(st, &_Py_ID(__classdict__), USE, LOCATION(annotation))) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue