mirror of https://github.com/python/cpython
bpo-43739: Add type declaration Doc/extending/extending.rst example
This commit is contained in:
parent
dccdc500f9
commit
ea9b2d6319
|
@ -410,7 +410,7 @@ optionally followed by an import of the module::
|
|||
/* Optionally import the module; alternatively,
|
||||
import can be deferred until the embedded script
|
||||
imports it. */
|
||||
pmodule = PyImport_ImportModule("spam");
|
||||
PyObject *pmodule = PyImport_ImportModule("spam");
|
||||
if (!pmodule) {
|
||||
PyErr_Print();
|
||||
fprintf(stderr, "Error: could not import module 'spam'\n");
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.
|
Loading…
Reference in New Issue