mirror of https://github.com/python/cpython
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):
|
||||
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):
|
||||
|
|
Loading…
Reference in New Issue