From 0dba8a8beb5e2a6f16042421455004c2e7587ed4 Mon Sep 17 00:00:00 2001 From: Brian May Date: Tue, 21 Aug 2018 08:36:51 +1000 Subject: [PATCH] Don't crash if we can't look up peername Peername is only used for information display messages. Fixes #259 --- sshuttle/ssnet.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sshuttle/ssnet.py b/sshuttle/ssnet.py index 49d4cb5..923a154 100644 --- a/sshuttle/ssnet.py +++ b/sshuttle/ssnet.py @@ -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'