From 642942a72fe544f9f6466f87c550755d707e3e47 Mon Sep 17 00:00:00 2001 From: Vadim Levin Date: Fri, 17 Feb 2023 12:26:41 +0300 Subject: [PATCH] fix: remove extra '/O' modifier for '/IO' arguments --- modules/python/src2/gen2.py | 9 +++++++++ modules/python/src2/hdr_parser.py | 2 ++ 2 files changed, 11 insertions(+) diff --git a/modules/python/src2/gen2.py b/modules/python/src2/gen2.py index 92629c0e7a..23f31c3e19 100755 --- a/modules/python/src2/gen2.py +++ b/modules/python/src2/gen2.py @@ -448,6 +448,15 @@ class ArgInfo(object): self.py_outputarg = False self.enclosing_arg = enclosing_arg + def __str__(self): + return 'ArgInfo("{}", tp="{}", default="{}", in={}, out={})'.format( + self.name, self.tp, self.defval, self.inputarg, + self.outputarg + ) + + def __repr__(self): + return str(self) + @property def export_name(self): if self.name in python_reserved_keywords: diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py index f5df3e2aab..710c792179 100755 --- a/modules/python/src2/hdr_parser.py +++ b/modules/python/src2/hdr_parser.py @@ -616,6 +616,8 @@ class CppHeaderParser(object): ("InputOutputArray", mat), ("OutputArray", mat), ("noArray", arg_type)]).strip() + if '/IO' in modlist and '/O' in modlist: + modlist.remove('/O') args.append([arg_type, arg_name, defval, modlist]) npos = arg_start-1