Skip to content

Commit

Permalink
fallback for os_name if user name is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
wawaka committed May 20, 2019
1 parent 4592862 commit 1c59b79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clickhouse_driver/clientinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ class QueryKind(object):
def __init__(self, client_name):
self.query_kind = ClientInfo.QueryKind.NO_QUERY

self.os_user = getpass.getuser()
try:
self.os_user = getpass.getuser()
except KeyError:
self.os_user = ''
self.client_hostname = socket.gethostname()
self.client_name = client_name

Expand Down

0 comments on commit 1c59b79

Please sign in to comment.