[BugFix] - Explicit error message when return type is not an OBBject (#6394)

* Send an explicit message when return type isn't an OBBject

* Update package_builder.py

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>

* lint

---------

Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
This commit is contained in:
Igor Radovanovic
2024-05-13 20:34:55 +02:00
committed by GitHub
parent 4ed5f054ca
commit 10dddfd893

View File

@@ -319,6 +319,8 @@ class ImportDefinition:
hint_type_list.append(parameter.annotation)
if return_type:
if not issubclass(return_type, OBBject):
raise ValueError("Return type must be an OBBject.")
hint_type = get_args(get_type_hints(return_type)["results"])[0]
hint_type_list.append(hint_type)