]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 68169-68170 via svnmerge from
authorGeorg Brandl <georg@python.org>
Sat, 3 Jan 2009 23:57:38 +0000 (23:57 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 3 Jan 2009 23:57:38 +0000 (23:57 +0000)
svn+ssh://svn.python.org/python/branches/py3k

........
  r68169 | georg.brandl | 2009-01-02 20:20:26 +0100 (Fri, 02 Jan 2009) | 2 lines

  Remove traces of Py_InitModule*.
........
  r68170 | georg.brandl | 2009-01-02 21:10:05 +0100 (Fri, 02 Jan 2009) | 2 lines

  #4808: move old API below new API doc.
........

Doc/library/threading.rst
Objects/moduleobject.c
PC/example_nt/example.c

index 01e71362a27763caaf93d7eb1c19c3c399657a32..769afd4ffec917a5a3a27a74d1d6be61c08ccc03 100644 (file)
@@ -278,12 +278,6 @@ impossible to detect the termination of alien threads.
    raises the same exception.
 
 
-.. method:: Thread.getName()
-            Thread.setName()
-
-   Old API for :attr:`~Thread.name`.
-
-
 .. attribute:: Thread.name
 
    A string used for identification purposes only. It has no semantics.
@@ -291,6 +285,13 @@ impossible to detect the termination of alien threads.
    constructor.
 
 
+.. method:: Thread.getName()
+            Thread.setName()
+
+   Old getter/setter API for :attr:`~Thread.name`; use it directly as a property
+   instead.
+
+
 .. attribute:: Thread.ident
 
    The 'thread identifier' of this thread or ``None`` if the thread has not been
@@ -309,12 +310,6 @@ impossible to detect the termination of alien threads.
    returns a list of all alive threads.
 
 
-.. method:: Thread.isDaemon()
-            Thread.setDaemon()
-
-   Old API for :attr:`~Thread.daemon`.
-
-
 .. attribute:: Thread.daemon
 
    The thread's daemon flag. This must be set before :meth:`start` is called,
@@ -325,6 +320,13 @@ impossible to detect the termination of alien threads.
    The entire Python program exits when no alive non-daemon threads are left.
 
 
+.. method:: Thread.isDaemon()
+            Thread.setDaemon()
+
+   Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a
+   property instead.
+
+
 .. _lock-objects:
 
 Lock Objects
index 7f81ce41bd858c654fdc9c7ef176799a85d63b4d..9c705b888d25e25a8d223db41b69237a36531f67 100644 (file)
@@ -91,9 +91,9 @@ PyModule_Create2(struct PyModuleDef* module, int module_api_version)
 
           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) {
index 953fb824e7f70fb4696c32e6ab4f7f5c835de4fc..d807311d96225509610458862bda7abcb4de0cce 100644 (file)
@@ -13,8 +13,20 @@ static PyMethodDef example_methods[] = {
        {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);
 }