diff options
author | Georg Brandl <georg@python.org> | 2012-07-01 07:47:54 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-07-01 07:47:54 (GMT) |
commit | 29feb1ffcaa45335c33fc0a8bade83304b238744 (patch) | |
tree | eb81f754be81cfb123586a2887a34b5ce170e325 /Doc | |
parent | 3aa0c9dcf3af9c7a17cadeb79de960ba025a0c29 (diff) | |
download | cpython-29feb1ffcaa45335c33fc0a8bade83304b238744.zip cpython-29feb1ffcaa45335c33fc0a8bade83304b238744.tar.gz cpython-29feb1ffcaa45335c33fc0a8bade83304b238744.tar.bz2 |
Make call of os.getppid() conditional: it is not available on Windows.
Diffstat (limited to 'Doc')
-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 a9512f3..f503f4d 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): |