Skip to content

Commit ea9b2d6

Browse files
bpo-43739: Add type declaration Doc/extending/extending.rst example
1 parent dccdc50 commit ea9b2d6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Doc/extending/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ optionally followed by an import of the module::
410410
/* Optionally import the module; alternatively,
411411
import can be deferred until the embedded script
412412
imports it. */
413-
pmodule = PyImport_ImportModule("spam");
413+
PyObject *pmodule = PyImport_ImportModule("spam");
414414
if (!pmodule) {
415415
PyErr_Print();
416416
fprintf(stderr, "Error: could not import module 'spam'\n");
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

0 commit comments

Comments
 (0)