mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 05:06:29 +08:00
fix: AST nodes required usage imports
This commit is contained in:
parent
726ba0210e
commit
06b40aef91
@ -759,8 +759,6 @@ def _generate_typing_module(root: NamespaceNode, output_path: Path) -> None:
|
||||
output_stream.write(f' "{alias_name}",\n')
|
||||
output_stream.write("]\n\n")
|
||||
|
||||
# HACK: force add cv2.mat_wrapper import to handle MatLike alias
|
||||
required_imports.add("import cv2.mat_wrapper")
|
||||
_write_required_imports(required_imports, output_stream)
|
||||
|
||||
# Add type checking time definitions as generated __init__.py content
|
||||
|
@ -561,13 +561,14 @@ class ContainerTypeNode(AggregatedTypeNode):
|
||||
@property
|
||||
def required_definition_imports(self) -> Generator[str, None, None]:
|
||||
yield "import typing"
|
||||
return super().required_definition_imports
|
||||
yield from super().required_definition_imports
|
||||
|
||||
@property
|
||||
def required_usage_imports(self) -> Generator[str, None, None]:
|
||||
if TypeNode.compatible_to_runtime_usage:
|
||||
yield "import typing"
|
||||
return super().required_usage_imports
|
||||
yield from super().required_usage_imports
|
||||
|
||||
@abc.abstractproperty
|
||||
def type_format(self) -> str:
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user