Commit 29feb1ff authored by Georg Brandl's avatar Georg Brandl

Make call of os.getppid() conditional: it is not available on Windows.

parent 3aa0c9dc
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment