pyatspi2 merge requestshttps://gitlab.gnome.org/GNOME/pyatspi2/-/merge_requests2024-01-10T22:30:51Zhttps://gitlab.gnome.org/GNOME/pyatspi2/-/merge_requests/30atspienum: Also catch TypeErrors when casting2024-01-10T22:30:51ZNiels De Graefnielsdegraef@gmail.comatspienum: Also catch TypeErrors when castingIn the `__eq__` we try to broadly compare any object towards the enum
by casting it to `int` and comparing the numbers. In some cases, casting
to `int` of course doesn't make sense, so there's an `except ValueError`
case to automaticall...In the `__eq__` we try to broadly compare any object towards the enum
by casting it to `int` and comparing the numbers. In some cases, casting
to `int` of course doesn't make sense, so there's an `except ValueError`
case to automatically return false without propagating that exception.
The problem now is that when trying to cast an object to an `int`
doesn't return a `ValueError`, but a `TypeError` instead, so this still
throws an uncaught exception. This seems to be happening when comparing
in practice when comparing `AtSpiEnum` with a `Accessible` object.
Fix this by also catching a `TypeError`.