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

Skip to content

Commit c9d2fc3

Browse files
committed
Merge with 3.2.
2 parents e4870b5 + 29feb1f commit c9d2fc3

2 files changed

Lines changed: 4 additions & 3 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]);

Doc/library/multiprocessing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ To show the individual process IDs involved, here is an expanded example::
7979
def info(title):
8080
print(title)
8181
print('module name:', __name__)
82-
print('parent process:', os.getppid())
82+
if hasattr(os, 'getppid'): # only available on Unix
83+
print('parent process:', os.getppid())
8384
print('process id:', os.getpid())
8485

8586
def f(name):

0 commit comments

Comments
 (0)