Merge pull request #23821 from asmorkalov:as/python_types_extra_imports

Force mat_wrapper import to satisfy dependencies for MatLike alias
pull/23820/head^2
Alexander Smorkalov 2 years ago committed by GitHub
commit f2f00259da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/python/src2/typing_stubs_generation/generation.py

@ -759,6 +759,8 @@ def _generate_typing_module(root: NamespaceNode, output_path: Path) -> None:
output_stream.write(f' "{alias_name}",\n') output_stream.write(f' "{alias_name}",\n')
output_stream.write("]\n\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) _write_required_imports(required_imports, output_stream)
# Add type checking time definitions as generated __init__.py content # Add type checking time definitions as generated __init__.py content

Loading…
Cancel
Save