Skip to content

Commit

Permalink
Make sure that ForbiddenExtraKeysError is created before ClassValidat…
Browse files Browse the repository at this point in the history
…ionError is raised.
  • Loading branch information
raabf committed Mar 25, 2022
1 parent 92fe330 commit b2e47b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cattrs/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def make_dict_structure_fn(
if _cattrs_forbid_extra_keys:
globs["__c_a"] = allowed_fields
globs["__c_feke"] = ForbiddenExtraKeysError
post_lines += [
lines += [
" unknown_fields = set(o.keys()) - __c_a",
" if unknown_fields:",
" raise __c_feke('', __cl, unknown_fields)",
Expand Down

0 comments on commit b2e47b5

Please sign in to comment.