Make call of os.getppid() conditional: it is not available on Windows.
This commit is contained in:
parent
1014686d76
commit
e683ef55fc
|
@ -81,7 +81,8 @@ To show the individual process IDs involved, here is an expanded example::
|
||||||
def info(title):
|
def info(title):
|
||||||
print title
|
print title
|
||||||
print 'module name:', __name__
|
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()
|
print 'process id:', os.getpid()
|
||||||
|
|
||||||
def f(name):
|
def f(name):
|
||||||
|
|
Loading…
Reference in New Issue