]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make call of os.getppid() conditional: it is not available on Windows.
authorGeorg Brandl <georg@python.org>
Sun, 1 Jul 2012 07:47:54 +0000 (09:47 +0200)
committerGeorg Brandl <georg@python.org>
Sun, 1 Jul 2012 07:47:54 +0000 (09:47 +0200)
Doc/library/multiprocessing.rst

index 303cdbcf93184ef42e15b3f69ca6795b75963c9f..bac9cf05b7043987114df200ff049b93ea25ba05 100644 (file)
@@ -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):