diff --git a/rollbar/__init__.py b/rollbar/__init__.py index 43a5241f..bac47857 100644 --- a/rollbar/__init__.py +++ b/rollbar/__init__.py @@ -1061,10 +1061,14 @@ def _build_server_data(): # server environment server_data = { 'host': socket.gethostname(), - 'argv': sys.argv, 'pid': os.getpid() } + # argv does not always exist in embedded python environments + argv = getattr(sys, 'argv', None) + if argv: + server_data['argv'] = argv + for key in ['branch', 'root']: if SETTINGS.get(key): server_data[key] = SETTINGS[key]