From 884091cce6b84b2e0b9aa491d9c4d2e8d1c580de Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Sun, 25 May 2008 21:43:38 +0100 Subject: [PATCH] Add the dummy methods to helper classes as well, so that unwrapped pure virtual methods are detected and the helper class disabled --- pybindgen/cppclass.py | 9 +++++++-- pybindgen/cppmethod.py | 11 +++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pybindgen/cppclass.py b/pybindgen/cppclass.py index 09213d0..4ce61e4 100644 --- a/pybindgen/cppclass.py +++ b/pybindgen/cppclass.py @@ -1020,8 +1020,13 @@ public: ## is a very important fact that needs to be ## recorded in the class, even if the method is ## not wrapped. - dummy = CppDummyMethod(*args, **kwargs) - self._dummy_methods.append(dummy) + method = CppDummyMethod(*args, **kwargs) + self._dummy_methods.append(method) + self._have_pure_virtual_methods = None + helper_class = self.get_helper_class() + if helper_class is not None: + helper_class.add_virtual_method(method) + return None self._add_method_obj(meth) return meth diff --git a/pybindgen/cppmethod.py b/pybindgen/cppmethod.py index 2b09171..8647578 100644 --- a/pybindgen/cppmethod.py +++ b/pybindgen/cppmethod.py @@ -283,6 +283,12 @@ class DummyReturnValue(ReturnValue): else: args, kwargs = utils.parse_retval_spec(arg) super(DummyReturnValue, self).__init__(args[0]) + def convert_c_to_python(self, wrapper): + raise CodeGenerationError + def convert_python_to_c(self, wrapper): + raise CodeGenerationError + def get_c_error_return(self): + return '' class DummyParameter(Parameter): @@ -304,6 +310,11 @@ class DummyParameter(Parameter): args, kwargs = utils.parse_param_spec(arg) super(DummyParameter, self).__init__(args[0], args[1]) + def convert_c_to_python(self, wrapper): + raise CodeGenerationError + def convert_python_to_c(self, wrapper): + raise CodeGenerationError + class CppDummyMethod(CppMethod): """