Commit e9cae3d
committed
Fix get_errors method
There was a lot wrong with it, even though it has never, to my
knowledge, failed.
It used getattr incorrectly, without providing a default value of false, so
that if the attribute was not present on the object, an AttributeError would
be raised regardless.
It would fall back on the context ancestor if there wasn't a cause,
although I suspect it never did. This also was wrong, because the
context would not give any help in determining the error message.
Neither of these code defects is ever known to have caused a bug, but
the ruff linter run by CodeRabbit objected to the construction, and it
was correct.
Signed-off-by: mulhern <amulhern@redhat.com>1 parent 7c057ca commit e9cae3d
1 file changed
+5
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
| |||
0 commit comments