Commit eb389f6
committed
fix(validation): handle functools.partial objects in type name access
Replace direct __name__ attribute access with getattr() fallback pattern
to safely handle functools.partial objects and other callable types that
may not have a __name__ attribute. This prevents AttributeError when
validating component data types that use partial functions.
- Use getattr(type, "__name__", repr(type)) for safe attribute access
- Apply fix in data_model_vehicle_components_validation.py (2 locations)
- Apply fix in data_model_vehicle_components_base.py (2 locations)
Fixes #12441 parent d55c8b0 commit eb389f6
File tree
2 files changed
+10
-6
lines changed- ardupilot_methodic_configurator
2 files changed
+10
-6
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
| 169 | + | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | | - | |
| 456 | + | |
| 457 | + | |
457 | 458 | | |
458 | | - | |
459 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
460 | 462 | | |
461 | 463 | | |
462 | 464 | | |
| |||
0 commit comments