Skip to content

Commit

Permalink
cosmetic: pylint warnings and better debug logging
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@21662 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 15, 2019
1 parent f8020f2 commit 3c7e41c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/xpra/net/bytestreams.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of Xpra.
# Copyright (C) 2011-2018 Antoine Martin <antoine@xpra.org>
# Copyright (C) 2011-2019 Antoine Martin <antoine@xpra.org>
# Copyright (C) 2008, 2009, 2010 Nathaniel Smith <njs@pobox.com>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.
Expand Down Expand Up @@ -303,7 +303,7 @@ def __init__(self, socket, local, remote, target, socktype, info={}):
self.protocol_type = "socket"
self.nodelay = None
self.cork = None
if type(remote)==str:
if isinstance(remote, str):
self.filename = remote
if SOCKET_NODELAY is not None and self.socktype in TCP_SOCKTYPES:
self.do_set_nodelay(SOCKET_NODELAY)
Expand Down Expand Up @@ -336,7 +336,7 @@ def close(self):
s = self._socket
try:
i = self.get_socket_info()
except:
except Exception:
i = s
log("%s.close() for socket=%s", self, i)
Connection.close(self)
Expand Down Expand Up @@ -425,7 +425,7 @@ def do_get_socket_info(self, s):
"SOCKET" : get_socket_options(s, socket.SOL_SOCKET, SOCKET_OPTIONS),
}
if self.socktype in ("tcp", "udp", "ws", "wss", "ssl"):
opts["IP"] = get_socket_options(s, socket.SOL_IP, IP_OPTIONS)
opts["IP"] = get_socket_options(s, socket.SOL_IP, IP_OPTIONS)
if self.socktype in ("tcp", "ws", "wss", "ssl"):
opts["TCP"] = get_socket_options(s, socket.IPPROTO_TCP, TCP_OPTIONS)
#ipv6: IPV6_ADDR_PREFERENCES, IPV6_CHECKSUM, IPV6_DONTFRAG, IPV6_DSTOPTS, IPV6_HOPOPTS,
Expand All @@ -448,6 +448,7 @@ def get_socket_options(sock, level, options):
try:
v = sock.getsockopt(level, opt)
except Exception as e:
log("sock.getsockopt(%i, %s)", level, k, exc_info=True)
errs.append(k)
else:
if v is not None:
Expand Down

0 comments on commit 3c7e41c

Please sign in to comment.