From 9ab9fd8c005171217346189f288d259923257d50 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Thu, 22 May 2008 18:53:52 +0100 Subject: [PATCH] Don't call a constructor, from a constructor wrapper, if it is not public --- pybindgen/cppmethod.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pybindgen/cppmethod.py b/pybindgen/cppmethod.py index 3fd957d..5ffac24 100644 --- a/pybindgen/cppmethod.py +++ b/pybindgen/cppmethod.py @@ -322,6 +322,8 @@ class CppConstructor(ForwardWrapperBase): self.before_call.indent() try: + if self.visibility != 'public': + raise CodeGenerationError class_.get_construct_name() except CodeGenerationError: self.before_call.write_code('PyErr_SetString(PyExc_TypeError, "class \'%s\' '