Skip to content

Commit c90dc08

Browse files
committed
Use ternary operator instead of or for deciding which data to dispatch
1 parent 4472f30 commit c90dc08

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mautrix/client/syncer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ async def run_internal_event(
258258
) -> None:
259259
kwargs["source"] = SyncStream.INTERNAL
260260
tasks = self.dispatch_manual_event(
261-
event_type, custom_type or kwargs, include_global_handlers=False
261+
event_type,
262+
custom_type if custom_type is not None else kwargs,
263+
include_global_handlers=False,
262264
)
263265
await asyncio.gather(*tasks)
264266

@@ -267,7 +269,9 @@ def dispatch_internal_event(
267269
) -> list[asyncio.Task]:
268270
kwargs["source"] = SyncStream.INTERNAL
269271
return self.dispatch_manual_event(
270-
event_type, custom_type or kwargs, include_global_handlers=False
272+
event_type,
273+
custom_type if custom_type is not None else kwargs,
274+
include_global_handlers=False,
271275
)
272276

273277
def _try_deserialize(self, type: Type[T], data: JSON) -> T | GenericEvent:

0 commit comments

Comments
 (0)