The guard read
if bus is not None and on_resume_callback is not None or on_suspend_callback is not None:
which parses as
(bus is not None and on_resume_callback is not None) or (on_suspend_callback is not None)
so a caller passing on_suspend_callback entered the body regardless of
whether the bus exists, and bus.add_signal_receiver() raised AttributeError
on None. gtk.py passes both callbacks under --restart-on-wake-up, so that
option crashed on any system without a running system dbus. Test the bus
separately and return early.
The success message was also logged even when no bus was connected.
|
||
|---|---|---|
| .. | ||
| hid_parser | ||
| hidapi | ||
| keysyms | ||
| logitech_receiver | ||
| solaar | ||