From 69c8d0351fa07069256aa47aa38cea74292461fb Mon Sep 17 00:00:00 2001 From: Benjamin Wohlwend Date: Mon, 19 Mar 2018 15:20:13 +0100 Subject: [PATCH] check if `os.getppid` is available before using it in Windows and Python 2.7, `os.getppid` is not available --- elasticapm/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticapm/base.py b/elasticapm/base.py index a96350258..f7187653a 100644 --- a/elasticapm/base.py +++ b/elasticapm/base.py @@ -374,7 +374,7 @@ def get_service_info(self): def get_process_info(self): return { 'pid': os.getpid(), - 'ppid': os.getppid(), + 'ppid': os.getppid() if hasattr(os, 'getppid') else None, 'argv': sys.argv, 'title': None, # Note: if we implement this, the value needs to be wrapped with keyword_field }