Replaced some new typing `|` notations with `Union`.
continuous-integration/drone/push Build is passing Details

The `|` notation breaks on Python < 3.10.
This commit is contained in:
Fabio Manganiello 2024-01-07 00:51:11 +01:00
parent 1cd328ef44
commit 3d2ee5d6bb
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
2 changed files with 4 additions and 2 deletions

View File

@ -62,6 +62,8 @@ class InspectPlugin(Plugin):
e,
)
self.logger.exception(e)
def refresh_cache(self, force: bool = False):
"""
Refreshes the components cache.

View File

@ -352,7 +352,7 @@ class MatrixClient(AsyncClient):
def get_devices_by_user(
self, user_id: Optional[str] = None
) -> Dict[str, Dict[str, OlmDevice]] | Dict[str, OlmDevice]:
) -> Union[Dict[str, Dict[str, OlmDevice]], Dict[str, OlmDevice]]:
devices = dict(self.device_store.items())
if user_id:
@ -371,7 +371,7 @@ class MatrixClient(AsyncClient):
def get_devices_by_room(
self, room_id: Optional[str] = None
) -> Dict[str, Dict[str, OlmDevice]] | Dict[str, OlmDevice]:
) -> Union[Dict[str, Dict[str, OlmDevice]], Dict[str, OlmDevice]]:
devices = {
room_id: {
device_id: device