From: Georg Brandl Date: Sun, 1 Jul 2012 07:47:54 +0000 (+0200) Subject: Make call of os.getppid() conditional: it is not available on Windows. X-Git-Tag: v2.7.4rc1~728 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e683ef55fca11d940794dde000d554e2b6c8f513;p=thirdparty%2FPython%2Fcpython.git Make call of os.getppid() conditional: it is not available on Windows. --- diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 303cdbcf9318..bac9cf05b704 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -81,7 +81,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):