summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2022-03-18 12:15:36 -0400
committerPeter LaFosse <peter@vector35.com>2022-03-23 14:52:09 -0400
commit33bddd0c8ad5c45a07c56caa964dd42631cd169c (patch)
treef1790d1abc1f3a5d24a389f8b0873714848ca812 /python
parente57e378f096377196c785df26ab171e5af71578f (diff)
Turn assert into ValueError
Diffstat (limited to 'python')
-rw-r--r--python/types.py6
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