Skip to content

Commit

Permalink
stop caring if the socket fails to close (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkjt2000 authored May 8, 2019
1 parent 2ed78fa commit 2542913
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions mcstatus/protocol/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ def write(self, data):
self.socket.send(data)

def __del__(self):
self.socket.close()
try:
self.socket.close()
except:
pass


class UDPSocketConnection(Connection):
Expand Down Expand Up @@ -181,4 +184,7 @@ def write(self, data):
self.socket.sendto(data, self.addr)

def __del__(self):
self.socket.close()
try:
self.socket.close()
except:
pass
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name='mcstatus',
version='2.2',
version='2.2.1',
author='Nathan Adams',
author_email='[email protected]',
url='https://pypi.python.org/pypi/mcstatus',
Expand Down

0 comments on commit 2542913

Please sign in to comment.