python/lib/gen_code.py: fix regression from previous commit
authorPaul Brossier <piem@piem.org>
Sat, 17 Sep 2016 00:31:39 +0000 (02:31 +0200)
committerPaul Brossier <piem@piem.org>
Sat, 17 Sep 2016 00:31:39 +0000 (02:31 +0200)
python/lib/gen_code.py

index c34f438..73826c1 100644 (file)
@@ -289,6 +289,9 @@ Py_{shortname}_new (PyTypeObject * pytype, PyObject * args, PyObject * kwds)
         name = p['name']
         return """
     self->{name} = {defval};
+    if ({name} != NULL) {{
+        self->{name} = {name};
+    }}
 """.format(defval = aubiodefvalue[name], name = name)
 
     def check_valid_smpl(self, p):