Don't crash if we can't look up peername

Peername is only used for information display messages.

Fixes #259
This commit is contained in:
Brian May 2018-08-21 08:36:51 +10:00
parent 7b6f082454
commit 0dba8a8beb

View File

@ -95,6 +95,8 @@ def _try_peername(sock):
_, e = sys.exc_info()[:2]
if e.args[0] not in (errno.ENOTCONN, errno.ENOTSOCK):
raise
except AttributeError:
pass
return 'unknown'