Skip to content

Commit 93083ce

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 73dfb66 commit 93083ce

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
@@ -846,7 +846,7 @@ def _build_closure(annotate, owner, is_class, stringifier_dict, *, allow_evaluat
846846
return None, None
847847
new_closure = []
848848
cell_dict = {}
849-
for name, cell in zip(annotate.__code__.co_freevars, annotate.__closure__):
849+
for name, cell in zip(annotate.__code__.co_freevars, annotate.__closure__, strict=True):
850850
cell_dict[name] = cell
851851
new_cell = None
852852
if allow_evaluation:

0 commit comments

Comments
 (0)