mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix baseinvocation call to __attribute__ to work with py3.9
This commit is contained in:
@ -615,7 +615,15 @@ def invocation_output(
|
||||
config=cls.__config__,
|
||||
)
|
||||
cls.__fields__.update({"type": output_type_field})
|
||||
cls.__annotations__.update({"type": output_type_annotation})
|
||||
|
||||
# to support 3.9, 3.10 and 3.11, as described in https://docs.python.org/3/howto/annotations.html
|
||||
annotations = (
|
||||
cls.__dict__.get("__annotations__", None)
|
||||
if isinstance(cls, type)
|
||||
else getattr(cls, "__annotations__", None)
|
||||
)
|
||||
if annotations:
|
||||
annotations.update({"type": output_type_annotation})
|
||||
|
||||
return cls
|
||||
|
||||
|
Reference in New Issue
Block a user