diff --git a/SWIG/Source/Modules/python.cxx b/SWIG/Source/Modules/python.cxx index 16d4615b3..5f13c7e7d 100644 --- a/SWIG/Source/Modules/python.cxx +++ b/SWIG/Source/Modules/python.cxx @@ -200,11 +200,16 @@ public: if (mod) { Node *options = Getattr(mod, "options"); if (options) { + int dirprot = 0; + if (Getattr(options, "dirprot")) { + dirprot = 1; + } + if (Getattr(options, "nodirprot")) { + dirprot = 0; + } if (Getattr(options, "directors")) { allow_directors(); - } - if (Getattr(options, "dirprot")) { - allow_dirprot(); + if (dirprot) allow_dirprot(); } mod_docstring = Getattr(options, "docstring"); package = Getattr(options, "package");