Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3aa0c9d

Browse files
committed
Fix inconsistent function name in embedding howto.
1 parent 4cf1cc7 commit 3aa0c9d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/extending/embedding.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ for data conversion between Python and C, and for error reporting. The
155155
interesting part with respect to embedding Python starts with ::
156156

157157
Py_Initialize();
158-
pName = PyString_FromString(argv[1]);
158+
pName = PyUnicode_FromString(argv[1]);
159159
/* Error checking of pName left out */
160160
pModule = PyImport_Import(pName);
161161

162162
After initializing the interpreter, the script is loaded using
163163
:c:func:`PyImport_Import`. This routine needs a Python string as its argument,
164-
which is constructed using the :c:func:`PyString_FromString` data conversion
164+
which is constructed using the :c:func:`PyUnicode_FromString` data conversion
165165
routine. ::
166166

167167
pFunc = PyObject_GetAttrString(pModule, argv[2]);

0 commit comments

Comments
 (0)