Better error messages

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2008-10-12 12:09:46 +01:00
1 parent 9c1dcf79df
commit af9c04c88b
1 file changed
+4 -2
+4 -2
View File
@@ -499,10 +499,12 @@ class CppConstructor(ForwardWrapperBase):
Returns the wrapper function name.
"""
if self.visibility == 'private':
raise CodeGenerationError("private constructor")
raise CodeGenerationError("Class %r has a private constructor ->"
" cannot generate a constructor for it" % self._class.full_name)
elif self.visibility == 'protected':
if self._class.helper_class is None:
raise CodeGenerationError("protected constructor and no helper class")
raise CodeGenerationError("Class %r has a protected constructor and no helper class"
" -> cannot generate a constructor for it" % self._class.full_name)
#assert isinstance(class_, CppClass)
tmp_sink = codesink.MemoryCodeSink()