From: Jack Jansen Date: Mon, 21 Nov 2005 13:24:25 +0000 (+0000) Subject: Enable optional "const" argument to _New routines. X-Git-Tag: v2.5a0~1141 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09eef173b26c073921609688deb08d0e567d8a30;p=python Enable optional "const" argument to _New routines. --- diff --git a/Tools/bgen/bgen/bgenObjectDefinition.py b/Tools/bgen/bgen/bgenObjectDefinition.py index 6fc65ad3bd..1a44ca43c6 100644 --- a/Tools/bgen/bgen/bgenObjectDefinition.py +++ b/Tools/bgen/bgen/bgenObjectDefinition.py @@ -7,6 +7,7 @@ class ObjectDefinition(GeneratorGroup): tp_flags = "Py_TPFLAGS_DEFAULT" basetype = None argref = "" # set to "*" if arg to _New should be pointer + argconst = "" # set to "const " if arg to _New should be const def __init__(self, name, prefix, itselftype): """ObjectDefinition constructor. May be extended, but do not override. @@ -97,8 +98,8 @@ class ObjectDefinition(GeneratorGroup): def outputNew(self): Output() - Output("%sPyObject *%s_New(%s %sitself)", self.static, self.prefix, - self.itselftype, self.argref) + Output("%sPyObject *%s_New(%s%s %sitself)", self.static, self.prefix, + self.argconst, self.itselftype, self.argref) OutLbrace() Output("%s *it;", self.objecttype) self.outputCheckNewArg()