Skip to content

Commit 575343d

Browse files
committed
check if os.getppid is available before using it (#179)
in Windows and Python 2.7, `os.getppid` is not available closes #179
1 parent 1e107f8 commit 575343d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

elasticapm/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def get_service_info(self):
374374
def get_process_info(self):
375375
return {
376376
'pid': os.getpid(),
377-
'ppid': os.getppid(),
377+
'ppid': os.getppid() if hasattr(os, 'getppid') else None,
378378
'argv': sys.argv,
379379
'title': None, # Note: if we implement this, the value needs to be wrapped with keyword_field
380380
}

0 commit comments

Comments
 (0)