Skip to content

Commit b860119

Browse files
raabfTinche
authored andcommitted
Make sure that ForbiddenExtraKeysError is created before ClassValidationError is raised.
1 parent 490893d commit b860119

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cattrs/gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def make_dict_structure_fn(
452452
if _cattrs_forbid_extra_keys:
453453
globs["__c_a"] = allowed_fields
454454
globs["__c_feke"] = ForbiddenExtraKeysError
455-
post_lines += [
455+
lines += [
456456
" unknown_fields = set(o.keys()) - __c_a",
457457
" if unknown_fields:",
458458
" raise __c_feke('', __cl, unknown_fields)",

0 commit comments

Comments
 (0)