From 8f773493b6c27a9b6bc3a1aceac107a0f3d669c8 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Wed, 15 Aug 2012 14:49:49 +0300 Subject: Issue #15656: fixing code sample in extending doc --- Doc/extending/extending.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index c4ced1a..7fd9f72 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -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); } -- cgit v0.12