mirror of
https://github.com/python/cpython.git
synced 2025-11-20 19:06:50 +00:00
bpo-43739: Add type declaration Doc/extending/extending.rst example
This commit is contained in:
parent
dccdc500f9
commit
ea9b2d6319
2 changed files with 2 additions and 1 deletions
|
|
@ -410,7 +410,7 @@ optionally followed by an import of the module::
|
||||||
/* Optionally import the module; alternatively,
|
/* Optionally import the module; alternatively,
|
||||||
import can be deferred until the embedded script
|
import can be deferred until the embedded script
|
||||||
imports it. */
|
imports it. */
|
||||||
pmodule = PyImport_ImportModule("spam");
|
PyObject *pmodule = PyImport_ImportModule("spam");
|
||||||
if (!pmodule) {
|
if (!pmodule) {
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
fprintf(stderr, "Error: could not import module 'spam'\n");
|
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…
Add table
Add a link
Reference in a new issue