mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
don't confuse users with unimportant and non-actionable error msg
Bug: b/310852966 Change-Id: I2c64a92a36b817043ff1f7abfa528d4c7aa449e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5030272 Reviewed-by: Michael Savigny <msavigny@google.com> Reviewed-by: Junji Watanabe <jwata@google.com> Commit-Queue: Anas Sulaiman <mrahs@google.com>
This commit is contained in:
@@ -123,12 +123,11 @@ def auth_cache_status():
|
||||
|
||||
def get_hostname():
|
||||
hostname = socket.gethostname()
|
||||
# In case that returned an address, make a best effort attempt to get
|
||||
# the hostname and ignore any errors.
|
||||
try:
|
||||
return socket.gethostbyaddr(hostname)[0]
|
||||
except Exception as e:
|
||||
print("socket.gethostbyaddr failed " +
|
||||
"(falling back to socket.gethostname): %s" % e,
|
||||
file=sys.stderr)
|
||||
except Exception:
|
||||
return hostname
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user