Do not quote docstrings, they are quoted in the parser

master
Yevgen Muntyan 2007-07-06 14:28:58 -05:00
parent d88ca5016a
commit 64ee228c87
2 changed files with 2 additions and 2 deletions

View File

@ -793,7 +793,7 @@ _wrap__get_symbol(PyObject *self, PyObject *args)
for name, cname, flags, docstring in functions:
self.fp.write(' else if (!strcmp(name, "%s")) {\n' % name)
self.fp.write(' static PyMethodDef ml = { '
'"%s", (PyCFunction)%s, %s, "%s"};\n' % (
'"%s", (PyCFunction)%s, %s, %s};\n' % (
name, cname, flags, docstring))
self.fp.write(' return PyCFunction_NewEx(&ml, NULL, modulename);\n')
self.fp.write(' }\n')

View File

@ -10,7 +10,7 @@ def unescape(s):
return s.replace('\r', '\\r').replace('\n', '\\n')
def make_docstring(lines):
return "(char *) " + '\n'.join(['"%s"' % unescape(s) for s in lines])
return "(char *) " + '\n'.join(['"%s"' % (unescape(s),) for s in lines])
# New Parameter class, wich emulates a tuple for compatibility reasons
class Parameter(object):