From f48e3618a622bdaf4f858dbcebb5d68b88f0cd71 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Wed, 2 Jan 2008 16:06:13 +0000 Subject: [PATCH] More effectively disable the helper class when pure virtual methods are found that cannot be generated. --- pybindgen/cppclass.py | 5 +++++ pybindgen/gccxmlparser.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/pybindgen/cppclass.py b/pybindgen/cppclass.py index 9c5041b..57eda51 100644 --- a/pybindgen/cppclass.py +++ b/pybindgen/cppclass.py @@ -680,6 +680,11 @@ public: if self.have_pure_virtual_methods and self.helper_class is None: self.cannot_be_constructed = True + def set_helper_class_disabled(self, flag=True): + self.helper_class_disabled = flag + if flag: + self.helper_class = None + def set_cannot_be_constructed(self, flag=True): self.cannot_be_constructed = flag diff --git a/pybindgen/gccxmlparser.py b/pybindgen/gccxmlparser.py index 4500bb1..7d56868 100644 --- a/pybindgen/gccxmlparser.py +++ b/pybindgen/gccxmlparser.py @@ -600,6 +600,7 @@ class ModuleParser(object): Warning, member.location.file_name, member.location.line) if pure_virtual: class_wrapper.set_cannot_be_constructed(True) + class_wrapper.set_helper_class_disabled(True) continue arguments = [] ok = True @@ -615,6 +616,7 @@ class ModuleParser(object): if not ok: if pure_virtual: class_wrapper.set_cannot_be_constructed(True) + class_wrapper.set_helper_class_disabled(True) continue if pure_virtual and not class_wrapper.allow_subclassing: