Skip to content

Commit

Permalink
fix: make interface optional on method calls
Browse files Browse the repository at this point in the history
The dbus spec allows the interface to be optional on
method calls. In that case, allow the message to match
on any method with a matching name and signature.

#315
  • Loading branch information
izak committed Feb 12, 2025
1 parent c713bf3 commit 1e61584
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dbus_fast/message_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ def _make_method_handler(
def _find_message_handler(
self, msg: _Message
) -> Optional[Callable[[Message, Callable[[Message], None]], None]]:
if "org.freedesktop.DBus." in msg.interface:
if msg.interface is not None and "org.freedesktop.DBus." in msg.interface:
if (
msg.interface == "org.freedesktop.DBus.Introspectable"
and msg.member == "Introspect"
Expand Down Expand Up @@ -957,7 +957,7 @@ def _find_message_handler(
continue

if (
msg.interface == interface.name
msg.interface in (None, interface.name)
and msg.member == method.name
and msg.signature == method.in_signature
):
Expand Down

0 comments on commit 1e61584

Please sign in to comment.