From 29feb1ffcaa45335c33fc0a8bade83304b238744 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 1 Jul 2012 09:47:54 +0200 Subject: [PATCH] Make call of os.getppid() conditional: it is not available on Windows. --- Doc/library/multiprocessing.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index a9512f3358a..f503f4dfb41 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):