From fc7083eaccdb726f09db1246dc1af1cc4ab046f3 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Sat, 22 Mar 2008 18:21:30 +0000 Subject: [PATCH] Check for the have_pure_virtual_methods flag recursively in parent classes. --- pybindgen/cppclass.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pybindgen/cppclass.py b/pybindgen/cppclass.py index 38cf533..29a609b 100644 --- a/pybindgen/cppclass.py +++ b/pybindgen/cppclass.py @@ -585,7 +585,12 @@ class CppClass(object): CodeGenerationError if none found""" if self.cannot_be_constructed: raise CodeGenerationError("%s cannot be constructed" % self.full_name) - if self.have_pure_virtual_methods: + have_pure_virtual_methods = False + cls = self + while cls is not None: + have_pure_virtual_methods = (have_pure_virtual_methods or cls.have_pure_virtual_methods) + cls = cls.parent + if have_pure_virtual_methods: raise CodeGenerationError("%s cannot be constructed" % self.full_name) else: return self.full_name