fix debug messages on UPnP binding

This commit is contained in:
Emil Lerch 2019-07-20 17:36:05 -07:00
parent 285af11af7
commit 4fd2ae599c
Signed by: lobo
GPG Key ID: CEC5F37C1BE5A481

View File

@ -298,18 +298,18 @@ class upnp_broadcast_responder(object):
try:
self.ssock.bind(('', self.port))
except Exception, e:
dbg("WARNING: Failed to bind %s:%d: %s", (self.ip, self.port, e))
except Exception as e:
dbg("WARNING: Failed to bind %s:%d: %s" % (self.ip, self.port, e))
ok = False
try:
self.ssock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, self.mreq)
except Exception, e:
dbg('WARNING: Failed to join multicast group:', e)
except Exception as e:
dbg('WARNING: Failed to join multicast group: %s' % str(e))
ok = False
except Exception, e:
dbg("Failed to initialize UPnP sockets:", e)
except Exception as e:
dbg("Failed to initialize UPnP sockets: %s" % str(e))
return False
if ok:
dbg("Listening for UPnP broadcasts")