[Python-checkins] cpython (merge 3.2 -> default): Merge with 3.2.
georg.brandl
python-checkins at python.org
Sun Jul 1 09:55:33 CEST 2012
http://hg.python.org/cpython/rev/071bdd4a636b
changeset: 77909:071bdd4a636b
parent: 77904:fae140c00954
parent: 77908:031862264304
user: Georg Brandl <georg at python.org>
date: Sun Jul 01 09:56:07 2012 +0200
summary:
Merge with 3.2.
files:
Doc/extending/embedding.rst | 4 ++--
Doc/library/multiprocessing.rst | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Doc/extending/embedding.rst b/Doc/extending/embedding.rst
--- a/Doc/extending/embedding.rst
+++ b/Doc/extending/embedding.rst
@@ -155,13 +155,13 @@
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
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -79,7 +79,8 @@
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):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list