File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -580,8 +580,9 @@ def wrapper(cls: Type[GenericBaseInvocation]) -> Type[GenericBaseInvocation]:
580580 config = cls .__config__ ,
581581 )
582582 cls .__fields__ .update ({"type" : invocation_type_field })
583- cls .__annotations__ .update ({"type" : invocation_type_annotation })
584-
583+ # to support 3.9, 3.10 and 3.11, as described in https://docs.python.org/3/howto/annotations.html
584+ if annotations := cls .__dict__ .get ("__annotations__" , None ):
585+ annotations .update ({"type" : invocation_type_annotation })
585586 return cls
586587
587588 return wrapper
@@ -617,8 +618,7 @@ def wrapper(cls: Type[GenericBaseInvocationOutput]) -> Type[GenericBaseInvocatio
617618 cls .__fields__ .update ({"type" : output_type_field })
618619
619620 # to support 3.9, 3.10 and 3.11, as described in https://docs.python.org/3/howto/annotations.html
620- annotations = cls .__dict__ .get ("__annotations__" , None )
621- if annotations :
621+ if annotations := cls .__dict__ .get ("__annotations__" , None ):
622622 annotations .update ({"type" : output_type_annotation })
623623
624624 return cls
You can’t perform that action at this time.
0 commit comments