Skip to content

Commit

Permalink
Fix bug involving MISSING vs None and fetch_server
Browse files Browse the repository at this point in the history
  • Loading branch information
Gobot1234 committed May 10, 2024
1 parent 28e6649 commit 2148548
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions steam/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,7 @@ async def server(self) -> GameServer:
"""Fetch the game server this user is currently playing on."""
if self.game_server_ip is None:
raise ValueError("User is not playing on a game server")
server = await self._state.client.fetch_server(
ip=self.game_server_ip, port=self.game_server_port if self.game_server_port is not None else MISSING
)
server = await self._state.client.fetch_server(ip=self.game_server_ip, port=self.game_server_port)
assert server is not None
return server

Expand Down
2 changes: 1 addition & 1 deletion steam/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ async def fetch_server(
self,
*,
ip: IPAdress | str,
port: int = ...,
port: int | None = None,
) -> GameServer | None: ...

async def fetch_server(
Expand Down

0 comments on commit 2148548

Please sign in to comment.