]> granicus.if.org Git - python/commitdiff
return the module object from PyMODINIT_FUNC
authorBenjamin Peterson <benjamin@python.org>
Wed, 24 Dec 2008 16:27:25 +0000 (16:27 +0000)
committerBenjamin Peterson <benjamin@python.org>
Wed, 24 Dec 2008 16:27:25 +0000 (16:27 +0000)
Doc/extending/extending.rst
Doc/includes/noddy.c
Doc/includes/noddy2.c
Doc/includes/noddy3.c
Doc/includes/noddy4.c

index ef2c726f1defeba359885bcab37458a4cfd2f7ce..17a8110961b23181c33e9f530dc4b911599f587b 100644 (file)
@@ -326,8 +326,8 @@ only non-\ ``static`` item defined in the module file::
        return PyModule_Create(&spammodule);
    }
 
-Note that PyMODINIT_FUNC declares the function as ``void`` return type,
-declares any special linkage declarations required by the platform, and for  C++
+Note that PyMODINIT_FUNC declares the function as ``PyObject *`` return type,
+declares any special linkage declarations required by the platform, and for C++
 declares the function as ``extern "C"``.
 
 When the Python program imports module :mod:`spam` for the first time,
index 26a49a91218745983a6800154a570070c5918113..b6b7d6feda339d8b3dd4365e542812fcac22164e 100644 (file)
@@ -52,4 +52,5 @@ PyInit_noddy(void)
 
     Py_INCREF(&noddy_NoddyType);
     PyModule_AddObject(m, "Noddy", (PyObject *)&noddy_NoddyType);
+    return m;
 }
index 5daecf9d8aca3826d0b13d1f051d0044f3f8eef7..db9c7a88d524bd9fda5d127d3d89023c1f4ee544 100644 (file)
@@ -186,4 +186,5 @@ PyInit_noddy2(void)
 
     Py_INCREF(&NoddyType);
     PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
+    return m;
 }
index 39cdfdbea3ebbc8582c6de50cf04911b5be79854..e98b87fdd3953a82ff713c85e2f747a9f30056c0 100644 (file)
@@ -239,4 +239,5 @@ PyInit_noddy3(void)
 
     Py_INCREF(&NoddyType);
     PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
+    return m;
 }
index 94507ecf82eaf675d857ce9c65fb41c66f29026f..5be00a796a96b0f3dc9b4cf8d4401976a1bdeadd 100644 (file)
@@ -221,4 +221,5 @@ PyInit_noddy4(void)
 
     Py_INCREF(&NoddyType);
     PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
+    return m;
 }