Exception handling

This commit is contained in:
mailchuck 2015-11-23 01:35:11 +01:00 committed by Peter Surda
parent 36ddbd365e
commit f77afe8fae

View File

@ -206,8 +206,14 @@ class uPnPThread(threading.Thread, StoppableThread):
for router in self.routers:
if router.extPort is None:
self.createPortMapping(router)
self.sock.shutdown(socket.SHUT_RDWR)
self.sock.close()
try:
self.sock.shutdown(socket.SHUT_RDWR)
except:
pass
try:
self.sock.close()
except:
pass
deleted = False
for router in self.routers:
if router.extPort is not None: