diff options
| author | Peter LaFosse <peter@vector35.com> | 2022-03-18 12:15:36 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2022-03-23 14:52:09 -0400 |
| commit | 33bddd0c8ad5c45a07c56caa964dd42631cd169c (patch) | |
| tree | f1790d1abc1f3a5d24a389f8b0873714848ca812 /python | |
| parent | e57e378f096377196c785df26ab171e5af71578f (diff) | |
Turn assert into ValueError
Diffstat (limited to 'python')
| -rw-r--r-- | python/types.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/python/types.py b/python/types.py index 2d29ac2d..2201e6a6 100644 --- a/python/types.py +++ b/python/types.py @@ -995,10 +995,8 @@ class FunctionBuilder(TypeBuilder): core_param.location.storage = param.location.storage elif isinstance(param, tuple): name, _type = param - assert isinstance(name, str), f"Conversion from unsupported function parameter type {type(param)}" - assert isinstance( - _type, (Type, TypeBuilder) - ), f"Conversion from unsupported function parameter type {type(param)}" + if not isinstance(name, str) or not isinstance(_type, (Type, TypeBuilder)): + raise ValueError(f"Conversion from unsupported function parameter type {type(param)}") core_param.name = name core_param.type = _type.handle core_param.typeConfidence = _type.confidence |
