Python and Tcl - improve error message for missing constructor when the reason is because the class is abstract.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11518 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2009-08-08 22:56:10 +00:00
commit 136bd5175a
3 changed files with 13 additions and 3 deletions

View file

@ -2984,7 +2984,7 @@ public:
Delete(realct);
}
if (!have_constructor) {
Printv(f_shadow_file, tab4, "def __init__(self, *args, **kwargs): raise AttributeError(\"No constructor defined\")\n", NIL);
Printv(f_shadow_file, tab4, "def __init__(self, *args, **kwargs): raise AttributeError(\"", "No constructor defined", (Getattr(n, "abstract") ? " - class is abstract" : ""), "\")\n", NIL);
} else if (fastinit) {
Printv(f_wrappers, "SWIGINTERN PyObject *", class_name, "_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {\n", NIL);