Skip to content

Commit 10e4d8b

Browse files
author
Lincoln Stein
committed
fix second place where __annotations__ called
1 parent 6c27862 commit 10e4d8b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

invokeai/app/invocations/baseinvocation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)