Skip to content

Commit 62c90df

Browse files
Raise an error if the annotate function's freevars and closure mismatch
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent e85d030 commit 62c90df

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/annotationlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ def _build_closure(annotate, owner, is_class, stringifier_dict, *, allow_evaluat
837837
return None, None
838838
new_closure = []
839839
cell_dict = {}
840-
for name, cell in zip(annotate.__code__.co_freevars, annotate.__closure__):
840+
for name, cell in zip(annotate.__code__.co_freevars, annotate.__closure__, strict=True):
841841
cell_dict[name] = cell
842842
new_cell = None
843843
if allow_evaluation:

0 commit comments

Comments
 (0)