diff options
author | Georg Brandl <georg@python.org> | 2012-07-01 09:47:54 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-07-01 09:47:54 +0200 |
commit | e683ef55fca11d940794dde000d554e2b6c8f513 (patch) | |
tree | 6954ac737dd3e15db934defad359e379cc8b9ec5 | |
parent | 1014686d764b6a1c78de123aa716cdd7c176bc81 (diff) | |
download | cpython-git-e683ef55fca11d940794dde000d554e2b6c8f513.tar.gz |
Make call of os.getppid() conditional: it is not available on Windows.
-rw-r--r-- | Doc/library/multiprocessing.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 303cdbcf93..bac9cf05b7 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): |