Commit 95faf8af authored by Stefan Behnel's avatar Stefan Behnel

use __Pyx_DOCSTR() and __Pyx_NAMESTR() for module docstring and name

parent 9a3489c1
...@@ -1714,14 +1714,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1714,14 +1714,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def generate_pymoduledef_struct(self, env, code): def generate_pymoduledef_struct(self, env, code):
if env.doc: if env.doc:
doc = env.doc_cname doc = "__Pyx_DOCSTR(%s)" % env.doc_cname
else: else:
doc = "0" doc = "0"
code.putln("") code.putln("")
code.putln("#if PY_MAJOR_VERSION >= 3") code.putln("#if PY_MAJOR_VERSION >= 3")
code.putln("static struct PyModuleDef %s = {" % Naming.pymoduledef_cname) code.putln("static struct PyModuleDef %s = {" % Naming.pymoduledef_cname)
code.putln(" PyModuleDef_HEAD_INIT,") code.putln(" PyModuleDef_HEAD_INIT,")
code.putln(' "%s",' % env.module_name) code.putln(' __Pyx_NAMESTR("%s"),' % env.module_name)
code.putln(" %s, /* m_doc */" % doc) code.putln(" %s, /* m_doc */" % doc)
code.putln(" -1, /* m_size */") code.putln(" -1, /* m_size */")
code.putln(" %s /* m_methods */," % env.method_table_cname) code.putln(" %s /* m_methods */," % env.method_table_cname)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment