mirror of
https://github.com/python/cpython.git
synced 2025-01-09 10:04:54 +08:00
Make call of os.getppid() conditional: it is not available on Windows.
This commit is contained in:
parent
3aa0c9dcf3
commit
29feb1ffca
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user