Skip to content

Conversation

hallvictoria
Copy link
Contributor

@hallvictoria hallvictoria commented Jun 2, 2025

Description

Previously, this was the check in get_function_return_type:

if typing_inspect.is_generic_type(
                    return_anno) and typing_inspect.get_origin(
                    return_anno).__name__ == 'Out':

If typing_inspect.get_origin(return_anno) returned None, there would be an error thrown saying AttributeError: 'NoneType' object has no attribute '__name__'.

This change introduces a new check to ensure that typing_inspect.get_origin(return_anno) is not None before checking the __name__ property.

Change is already present in V1 & V2 runtimes.

Fixes #1688


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and CI is passing.

Quality of Code and Contribution Guidelines

@hallvictoria hallvictoria marked this pull request as ready for review August 27, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Opportunistic code in get_function_return_type.
1 participant