Skip to content

Commit

Permalink
Merge pull request #131 from foxpass/master
Browse files Browse the repository at this point in the history
sys.argv does not exist in some environments where the Python interpreter is embedded.
  • Loading branch information
brianr authored Feb 10, 2017
2 parents 0e65900 + bdce937 commit 607c95f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rollbar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 607c95f

Please sign in to comment.