summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShreyan Avigyan <shreyan.avigyan@gmail.com>2021-04-10 15:54:32 (GMT)
committerGitHub <noreply@github.com>2021-04-10 15:54:32 (GMT)
commitea9b2d631902238acf69e51af6e3d308567b5dfd (patch)
treedbe295c42279f66aff164125b28619c5b6e73f35
parentdccdc500f9b5dab0a20407ae0178d393796a8828 (diff)
downloadcpython-ea9b2d631902238acf69e51af6e3d308567b5dfd.zip
cpython-ea9b2d631902238acf69e51af6e3d308567b5dfd.tar.gz
cpython-ea9b2d631902238acf69e51af6e3d308567b5dfd.tar.bz2
bpo-43739: Add type declaration Doc/extending/extending.rst example
-rw-r--r--Doc/extending/extending.rst2
-rw-r--r--Misc/NEWS.d/next/Documentation/2021-04-06-07-05-49.bpo-43739.L4HjiX.rst1
2 files changed, 2 insertions, 1 deletions
diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst
index 25dc293..bc85a05 100644
--- a/Doc/extending/extending.rst
+++ b/Doc/extending/extending.rst
@@ -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");
diff --git a/Misc/NEWS.d/next/Documentation/2021-04-06-07-05-49.bpo-43739.L4HjiX.rst b/Misc/NEWS.d/next/Documentation/2021-04-06-07-05-49.bpo-43739.L4HjiX.rst
new file mode 100644
index 0000000..9f8d362
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2021-04-06-07-05-49.bpo-43739.L4HjiX.rst
@@ -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. \ No newline at end of file