From 1aef599260dc75b0d27191bdaa3ea6de0353d368 Mon Sep 17 00:00:00 2001 From: mhh Date: Thu, 17 Aug 2023 11:44:35 +0200 Subject: [PATCH] fix compatibility with python < v3.10 --- src/aleph/sdk/node.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aleph/sdk/node.py b/src/aleph/sdk/node.py index bb98daa8..e756c041 100644 --- a/src/aleph/sdk/node.py +++ b/src/aleph/sdk/node.py @@ -1,6 +1,7 @@ import asyncio import json import logging +import typing from datetime import datetime from functools import partial from pathlib import Path @@ -265,7 +266,7 @@ def __str__(self) -> str: @staticmethod def add(messages: Union[AlephMessage, Iterable[AlephMessage]]): - if isinstance(messages, AlephMessage): + if isinstance(messages, typing.get_args(AlephMessage)): messages = [messages] data_source = (message_to_model(message) for message in messages)