Issue #15656: fixing code sample in extending doc
authorEli Bendersky <eliben@gmail.com>
Wed, 15 Aug 2012 11:49:49 +0000 (14:49 +0300)
committerEli Bendersky <eliben@gmail.com>
Wed, 15 Aug 2012 11:49:49 +0000 (14:49 +0300)
Doc/extending/extending.rst

index c4ced1af8b79b34a1767d6931a0022ac39651c7d..7fd9f7237df5bae77a1d5139f8b9d684fdb03844 100644 (file)
@@ -735,13 +735,18 @@ Philbrick (philbrick@hks.com)::
        {NULL, NULL, 0, NULL}   /* sentinel */
    };
 
-::
+   static struct PyModuleDef keywdargmodule = {
+       PyModuleDef_HEAD_INIT,
+       "keywdarg",
+       NULL,
+       -1,
+       keywdarg_methods
+   };
 
-   void
-   initkeywdarg(void)
+   PyMODINIT_FUNC
+   PyInit_keywdarg(void)
    {
-     /* Create the module and add the functions */
-     Py_InitModule("keywdarg", keywdarg_methods);
+       return PyModule_Create(&keywdargmodule);
    }