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:
parent
e69c547289
commit
5394efadec
1 changed files with 3 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue