From 69ebecc54f1dbc80e4cf8f0905eb79f6c1022247 Mon Sep 17 00:00:00 2001 From: Vadim Levin Date: Thu, 15 Jun 2023 23:10:10 +0300 Subject: [PATCH] feat: add OpenCV error class to cv2/__init__.pyi --- modules/python/src2/typing_stubs_generation/api_refinement.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/python/src2/typing_stubs_generation/api_refinement.py b/modules/python/src2/typing_stubs_generation/api_refinement.py index a3468c1567..f23167f914 100644 --- a/modules/python/src2/typing_stubs_generation/api_refinement.py +++ b/modules/python/src2/typing_stubs_generation/api_refinement.py @@ -8,6 +8,10 @@ from .ast_utils import find_function_node, SymbolName def apply_manual_api_refinement(root: NamespaceNode) -> None: + # Export OpenCV exception class + builtin_exception = root.add_class("Exception") + builtin_exception.is_exported = False + root.add_class("error", (builtin_exception, )) for symbol_name, refine_symbol in NODES_TO_REFINE.items(): refine_symbol(root, symbol_name)