From 6fc88beac1206e8f78aa38b1a6b042295b14eb5c Mon Sep 17 00:00:00 2001 From: PrVrSs Date: Wed, 22 Nov 2023 01:41:57 +0600 Subject: [PATCH] fix --- idl2js/idl/__init__.py | 2 +- idl2js/idl/definitions/helper.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/idl2js/idl/__init__.py b/idl2js/idl/__init__.py index cc0634c..16729fb 100644 --- a/idl2js/idl/__init__.py +++ b/idl2js/idl/__init__.py @@ -21,7 +21,7 @@ def make_idl_type(definition): case DefinitionEnum.DICTIONARY: return DictionaryVisitor().run(node=definition) case DefinitionEnum.NAMESPACE: - logger.warning(f'Not implemented {DefinitionEnum.NAMESPACE}') + logger.warning('Not implemented %s', DefinitionEnum.NAMESPACE) return None case _: raise UnknownDefinitionType(f'Unknown {definition.type=}') diff --git a/idl2js/idl/definitions/helper.py b/idl2js/idl/definitions/helper.py index e4241af..061a413 100644 --- a/idl2js/idl/definitions/helper.py +++ b/idl2js/idl/definitions/helper.py @@ -77,8 +77,8 @@ def handle_type(idl_type: Type): return value, TypeFlag.OPTIONAL case IDLType(value): return value, TypeFlag.NONE - case IDLUnion(_): - raise IDL2JSException + case IDLUnion(items): + return items[0], TypeFlag.SEQUENCE case _: raise IDL2JSException