Skip to content

Commit

Permalink
Don't use bare except
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDrike committed Feb 13, 2022
1 parent d19b4ac commit 8868bd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions mcstatus/protocol/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def write(self, data: Union[bytes, bytearray]) -> None:
def __del__(self):
try:
self.socket.close()
except:
except Exception: # TODO: Check what this actually excepts
pass


Expand Down Expand Up @@ -257,7 +257,7 @@ def write(self, data: Union[Connection, bytes, bytearray]) -> None:
def __del__(self):
try:
self.socket.close()
except:
except Exception: # TODO: Check what this actually excepts
pass


Expand Down Expand Up @@ -290,7 +290,7 @@ def write(self, data: Union[bytes, bytearray]) -> None:
def __del__(self):
try:
self.writer.close()
except:
except Exception: # TODO: Check what this actually expects
pass


Expand Down Expand Up @@ -328,5 +328,5 @@ async def write(self, data: Union[Connection, bytes, bytearray]) -> None:
def __del__(self):
try:
self.stream.close()
except:
except Exception: # TODO: Check what this actually excepts
pass
2 changes: 1 addition & 1 deletion mcstatus/scripts/mcstatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def json():
data["host_port"] = query_res.raw["hostport"]
data["map"] = query_res.map
data["plugins"] = query_res.software.plugins
except:
except Exception: # TODO: Check what this actually excepts
pass
click.echo(json_dumps(data))

Expand Down

0 comments on commit 8868bd4

Please sign in to comment.