Browse Source

Fix support for passing keyword arguments to methods named make()
such as *Attrib.make() and Shader.make()

rdb 9 years ago
parent
commit
955ca0d334
2 changed files with 6 additions and 0 deletions
  1. 1 0
      doc/ReleaseNotes
  2. 5 0
      dtool/src/interrogate/functionRemap.cxx

+ 1 - 0
doc/ReleaseNotes

@@ -42,6 +42,7 @@ This issue fixes several bugs that were still found in 1.9.2.
 * Fix mipmap filtering issues in tinydisplay renderer
 * Fix exception when creating intervals before ShowBase is started
 * Fix rare X11 .ico cursor bug; also now supports PNG-compressed icons
+* Add keyword argument support to make() methods such as Shader.make()
 
 ------------------------  RELEASE 1.9.2  ------------------------
 

+ 5 - 0
dtool/src/interrogate/functionRemap.cxx

@@ -810,6 +810,11 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
         _flags |= F_coerce_constructor;
       }
 
+      if (_args_type == InterfaceMaker::AT_varargs) {
+        // Of course methods named "make" can still take kwargs.
+        _args_type = InterfaceMaker::AT_keyword_args;
+      }
+
     } else if (fname == "operator /") {
       if (_has_this && _parameters.size() == 2 &&
           TypeManager::is_float(_parameters[1]._remap->get_new_type())) {