Small character device verification cleanup
Followup for https://github.com/gvalkov/python-evdev/pull/228
~Because the quick fix for the `raise` is still, in some way, using exceptions for control flow, and I don't like raising some exception just to replace it with a different one shortly afterwards. Also, OSError is wrong there and just happened to work for the time being. I also wanted to avoid solutions that define msg multiple times (inside the if, and inside the except), and avoid creating/formatting msg before any exception happened. So it had to be `except: pass` to raise the exception at the end of the method. This is somewhat hard to get beautiful and good-practice.~
edit: looks pretty with assert.
Added 2 more tests.
合并状态:已合并 合并于 2025-01-21 关闭于 2025-01-21 0 条评论