[Python-checkins] r68169 - in python/branches/py3k: Objects/moduleobject.c PC/example_nt/example.c

georg.brandl python-checkins at python.org
Fri Jan 2 20:20:26 CET 2009


Author: georg.brandl
Date: Fri Jan  2 20:20:26 2009
New Revision: 68169

Log:
Remove traces of Py_InitModule*.


Modified:
   python/branches/py3k/Objects/moduleobject.c
   python/branches/py3k/PC/example_nt/example.c

Modified: python/branches/py3k/Objects/moduleobject.c
==============================================================================
--- python/branches/py3k/Objects/moduleobject.c	(original)
+++ python/branches/py3k/Objects/moduleobject.c	Fri Jan  2 20:20:26 2009
@@ -91,9 +91,9 @@
 
 	   This is a bit of a hack: when the shared library is loaded,
 	   the module name is "package.module", but the module calls
-	   Py_InitModule*() with just "module" for the name.  The shared
+	   PyModule_Create*() with just "module" for the name.  The shared
 	   library loader squirrels away the true name of the module in
-	   _Py_PackageContext, and Py_InitModule*() will substitute this
+	   _Py_PackageContext, and PyModule_Create*() will substitute this
 	   (if the name actually matches).
 	*/
 	if (_Py_PackageContext != NULL) {

Modified: python/branches/py3k/PC/example_nt/example.c
==============================================================================
--- python/branches/py3k/PC/example_nt/example.c	(original)
+++ python/branches/py3k/PC/example_nt/example.c	Fri Jan  2 20:20:26 2009
@@ -13,8 +13,20 @@
 	{NULL, NULL}
 };
 
+static struct PyModuleDef examplemodule = {
+	PyModuleDef_HEAD_INIT,
+	"example",
+	"example module doc string",
+	-1,
+	example_methods,
+	NULL,
+	NULL,
+	NULL,
+	NULL
+};
+
 PyMODINIT_FUNC
-initexample(void)
+PyInit_example(void)
 {
-	Py_InitModule("example", example_methods);
+	return PyModule_Create(&examplemodule);
 }


More information about the Python-checkins mailing list