[Python-checkins] cpython (3.2): Make call of os.getppid() conditional: it is not available on Windows.
georg.brandl
python-checkins at python.org
Sun Jul 1 09:49:27 CEST 2012
http://hg.python.org/cpython/rev/031862264304
changeset: 77908:031862264304
branch: 3.2
user: Georg Brandl <georg at python.org>
date: Sun Jul 01 09:47:54 2012 +0200
summary:
Make call of os.getppid() conditional: it is not available on Windows.
files:
Doc/library/multiprocessing.rst | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
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