From 2bbe31a8f6e2e53d65d48b1acbc70ba2aee36659 Mon Sep 17 00:00:00 2001 From: Hamdi Sahloul Date: Sat, 25 Aug 2018 14:15:50 +0900 Subject: [PATCH] Support non-static phantom methods for binding generator --- modules/python/src2/gen2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/python/src2/gen2.py b/modules/python/src2/gen2.py index 040207ea7f..497fe8e11b 100755 --- a/modules/python/src2/gen2.py +++ b/modules/python/src2/gen2.py @@ -740,7 +740,7 @@ class FuncInfo(object): if v.rettype: code_decl += " " + v.rettype + " retval;\n" code_fcall += "retval = " - if ismethod and not self.is_static: + if not v.isphantom and ismethod and not self.is_static: code_fcall += "_self_->" + self.cname else: code_fcall += self.cname @@ -961,7 +961,8 @@ class PythonWrapperGenerator(object): func.add_variant(decl, isphantom) else: if classname and not isconstructor: - cname = barename + if not isphantom: + cname = barename func_map = self.classes[classname].methods else: func_map = self.namespaces.setdefault(namespace, Namespace()).funcs