Skip to content

Commit e683ef5

Browse files
committed
Make call of os.getppid() conditional: it is not available on Windows.
1 parent 1014686 commit e683ef5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/multiprocessing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ To show the individual process IDs involved, here is an expanded example::
8181
def info(title):
8282
print title
8383
print 'module name:', __name__
84-
print 'parent process:', os.getppid()
84+
if hasattr(os, 'getppid'): # only available on Unix
85+
print 'parent process:', os.getppid()
8586
print 'process id:', os.getpid()
8687

8788
def f(name):

0 commit comments

Comments
 (0)