From 3a3c0464bd719a8cac6e52b02a3479b2834b88a4 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sat, 10 Apr 2021 09:19:11 -0700 Subject: [PATCH] bpo-43739: Add type declaration Doc/extending/extending.rst example (GH-25332) --- Doc/extending/extending.rst | 2 +- .../next/Documentation/2021-04-06-07-05-49.bpo-43739.L4HjiX.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Documentation/2021-04-06-07-05-49.bpo-43739.L4HjiX.rst diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 25dc2934d29e..bc85a05ff2f8 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 000000000000..9f8d3625e796 --- /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 -- 2.47.3