diff options
author | Georg Brandl <georg@python.org> | 2012-07-01 07:56:07 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-07-01 07:56:07 (GMT) |
commit | c9d2fc390d7eee2bc8c19e029ea4958aa10a4922 (patch) | |
tree | e385a33dd2e707585497d8a68f2bfb65aaad11c2 /Doc | |
parent | e4870b511796293b5e6cb82809ea035c54079e90 (diff) | |
parent | 29feb1ffcaa45335c33fc0a8bade83304b238744 (diff) | |
download | cpython-c9d2fc390d7eee2bc8c19e029ea4958aa10a4922.zip cpython-c9d2fc390d7eee2bc8c19e029ea4958aa10a4922.tar.gz cpython-c9d2fc390d7eee2bc8c19e029ea4958aa10a4922.tar.bz2 |
Merge with 3.2.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/extending/embedding.rst | 4 | ||||
-rw-r--r-- | Doc/library/multiprocessing.rst | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Doc/extending/embedding.rst b/Doc/extending/embedding.rst index 3143c99..d004d24 100644 --- a/Doc/extending/embedding.rst +++ b/Doc/extending/embedding.rst @@ -155,13 +155,13 @@ for data conversion between Python and C, and for error reporting. The interesting part with respect to embedding Python starts with :: Py_Initialize(); - pName = PyString_FromString(argv[1]); + pName = PyUnicode_FromString(argv[1]); /* Error checking of pName left out */ pModule = PyImport_Import(pName); After initializing the interpreter, the script is loaded using :c:func:`PyImport_Import`. This routine needs a Python string as its argument, -which is constructed using the :c:func:`PyString_FromString` data conversion +which is constructed using the :c:func:`PyUnicode_FromString` data conversion routine. :: pFunc = PyObject_GetAttrString(pModule, argv[2]); diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index fe5b81f..edc1bb9 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -79,7 +79,8 @@ To show the individual process IDs involved, here is an expanded example:: def info(title): print(title) print('module name:', __name__) - print('parent process:', os.getppid()) + if hasattr(os, 'getppid'): # only available on Unix + print('parent process:', os.getppid()) print('process id:', os.getpid()) def f(name): |