@@ -340,7 +340,7 @@ def make_dict_structure_fn(
340
340
lines .append (f"{ i } except Exception as e:" )
341
341
i = f"{ i } "
342
342
lines .append (
343
- f"{ i } e.__note__ = 'Structuring class { cl .__qualname__ } @ attribute { an } ' "
343
+ f"{ i } e.__note__ = 'Structuring class ' + { cl .__qualname__ !r } + ' @ attribute', { an } "
344
344
)
345
345
lines .append (f"{ i } errors.append(e)" )
346
346
@@ -352,15 +352,15 @@ def make_dict_structure_fn(
352
352
]
353
353
354
354
post_lines .append (
355
- f" if errors: raise __c_cve('While structuring { cl .__name__ } ' , errors, __cl)"
355
+ f" if errors: raise __c_cve('While structuring ' + { cl .__name__ !r } , errors, __cl)"
356
356
)
357
357
instantiation_lines = (
358
358
[" try:" ]
359
359
+ [" return __cl(" ]
360
360
+ [f" { line } " for line in invocation_lines ]
361
361
+ [" )" ]
362
362
+ [
363
- f" except Exception as exc: raise __c_cve('While structuring { cl .__name__ } ' , [exc], __cl)"
363
+ f" except Exception as exc: raise __c_cve('While structuring ' + { cl .__name__ !r } , [exc], __cl)"
364
364
]
365
365
)
366
366
else :
@@ -717,7 +717,7 @@ def make_mapping_structure_fn(
717
717
lines .append (" errors.append(e)" )
718
718
lines .append (" if errors:" )
719
719
lines .append (
720
- f" raise IterableValidationError(' While structuring { cl !r} ' , errors, __cattr_mapping_cl)"
720
+ f' raise IterableValidationError(" While structuring " + { repr ( cl ) !r} , errors, __cattr_mapping_cl)'
721
721
)
722
722
else :
723
723
lines .append (f" res = {{{ k_s } : { v_s } for k, v in mapping.items()}}" )
0 commit comments