summaryrefslogtreecommitdiffstats
path: root/Doc/extending
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2012-08-15 11:49:49 (GMT)
committerEli Bendersky <eliben@gmail.com>2012-08-15 11:49:49 (GMT)
commit8f773493b6c27a9b6bc3a1aceac107a0f3d669c8 (patch)
treeb2d93c2f8329e5d709e4ffb74a15e95ce0141334 /Doc/extending
parent2b209cd78d5a36d63b00d0a4350b78aec7bc820b (diff)
downloadcpython-8f773493b6c27a9b6bc3a1aceac107a0f3d669c8.zip
cpython-8f773493b6c27a9b6bc3a1aceac107a0f3d669c8.tar.gz
cpython-8f773493b6c27a9b6bc3a1aceac107a0f3d669c8.tar.bz2
Issue #15656: fixing code sample in extending doc
Diffstat (limited to 'Doc/extending')
-rw-r--r--Doc/extending/extending.rst15
1 files 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);
}