Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 134d3da

Browse files
author
David Robertson
committed
Fix the context complaint differently
1 parent 1569b14 commit 134d3da

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

synapse/storage/databases/main/devices.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,8 @@ async def add_device_list_outbound_pokes(
18651865
18661866
Marks the associated row in `device_lists_changes_in_room` as handled.
18671867
"""
1868+
if context is None:
1869+
context = {}
18681870

18691871
def add_device_list_outbound_pokes_txn(
18701872
txn: LoggingTransaction, stream_ids: List[int]
@@ -1876,7 +1878,9 @@ def add_device_list_outbound_pokes_txn(
18761878
device_ids=[device_id],
18771879
hosts=hosts,
18781880
stream_ids=stream_ids,
1879-
context=context,
1881+
# mypy doesn't know that `context` is never None here, see
1882+
# https://mypy.readthedocs.io/en/stable/common_issues.html#narrowing-and-inner-functions
1883+
context=context, # type: ignore[arg-type]
18801884
)
18811885

18821886
self.db_pool.simple_update_txn(

0 commit comments

Comments
 (0)