From fe261114bc116af25ad7b2e3791cf3019fdd0414 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Mon, 30 Jun 2008 15:24:03 +0100 Subject: [PATCH] CppClassRefParameter should check if class is constructible only when the parameter has a default value. --- pybindgen/cppclass.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pybindgen/cppclass.py b/pybindgen/cppclass.py index aeaa69a..e952a42 100644 --- a/pybindgen/cppclass.py +++ b/pybindgen/cppclass.py @@ -1717,7 +1717,6 @@ class CppClassRefParameter(CppClassParameterBase): assert isinstance(wrapper, ForwardWrapperBase) assert isinstance(self.cpp_class, CppClass) - if self.direction == Parameter.DIRECTION_IN: if self.take_value_from_python_self: self.py_name = 'self' @@ -1726,8 +1725,8 @@ class CppClassRefParameter(CppClassParameterBase): else: implicit_conversion_sources = self.cpp_class.get_all_implicit_conversions() if not (implicit_conversion_sources and self.is_const): - self.cpp_class.get_construct_name() # raises an exception if the class cannot be constructed if self.default_value is not None: + self.cpp_class.get_construct_name() # raises an exception if the class cannot be constructed self.py_name = wrapper.declarations.declare_variable( self.cpp_class.pystruct+'*', self.name, 'NULL') wrapper.parse_params.add_parameter(