Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/extending/windows.rst

    r2 r391  
    9999   not necessarily have to match the module name, but the name of the
    100100   initialization function should match the module name --- you can only import a
    101    module :mod:`spam` if its initialization function is called :cfunc:`initspam`,
    102    and it should call :cfunc:`Py_InitModule` with the string ``"spam"`` as its
     101   module :mod:`spam` if its initialization function is called :c:func:`initspam`,
     102   and it should call :c:func:`Py_InitModule` with the string ``"spam"`` as its
    103103   first argument (use the minimal :file:`example.c` in this directory as a guide).
    104104   By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`.
     
    115115
    116116#. Copy :file:`example.sln` and :file:`example.vcproj`, rename them to
    117       :file:`spam.\*`, and edit them by hand, or
     117   :file:`spam.\*`, and edit them by hand, or
    118118
    119119#. Create a brand new project; instructions are below.
     
    176176   PyObject_HEAD_INIT(&PyType_Type)
    177177
    178 Change it to::
     178Static type object initializers in extension modules may cause
     179compiles to fail with an error message like "initializer not a
     180constant".  This shows up when building DLL under MSVC.  Change it to::
    179181
    180182   PyObject_HEAD_INIT(NULL)
     
    182184and add the following to the module initialization function::
    183185
    184    MyObject_Type.ob_type = &PyType_Type;
    185 
    186 Refer to section 3 of the `Python FAQ <http://www.python.org/doc/faq>`_ for
    187 details on why you must do this.
     186   if (PyType_Ready(&MyObject_Type) < 0)
     187        return NULL;
    188188
    189189
     
    264264The first command created three files: :file:`spam.obj`, :file:`spam.dll` and
    265265:file:`spam.lib`.  :file:`Spam.dll` does not contain any Python functions (such
    266 as :cfunc:`PyArg_ParseTuple`), but it does know how to find the Python code
     266as :c:func:`PyArg_ParseTuple`), but it does know how to find the Python code
    267267thanks to :file:`pythonXY.lib`.
    268268
Note: See TracChangeset for help on using the changeset viewer.