add more details for director when __init__ is not call

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7024 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-03-05 00:09:07 +00:00
commit 5394efadec

View file

@ -2778,6 +2778,9 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
if (dirprot_mode() && !is_public(n))
Printf(w->code, "swig_set_inner(\"%s\", true);\n", name);
Printf(w->code, "if (!swig_get_self()) {\n");
Printf(w->code, " throw Swig::DirectorException(\"Swig director 'self' unitialized, maybe you forgot to call %s.__init__.\");\n", classname);
Printf(w->code, "}\n");
if (Len(parse_args) > 0) {
Printf(w->code, "result = PyObject_CallMethod(swig_get_self(), (char *)\"%s\", (char *)\"(%s)\" %s);\n", pyname, parse_args, arglist);
} else {