Skip to content

Commit

Permalink
Fix bug detected in python/mypy#15645
Browse files Browse the repository at this point in the history
  • Loading branch information
Gobot1234 committed Jul 15, 2023
1 parent d8811d9 commit e7fbdfc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion steam/clan.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ async def chunk(self) -> Sequence[ClanMember]:
return self.members

self._members = dict.fromkeys(self._partial_members) # type: ignore
if self.flags & ClanAccountFlags.Large if self.flags is not None else len(self._partial_members) <= 100:
if self.flags & ClanAccountFlags.Large > 0 if self.flags is not None else len(self._partial_members) <= 100:
for user, member in zip(
await self._state._maybe_users(parse_id64(id, type=Type.Individual) for id in self._partial_members),
self._partial_members.values(),
Expand Down
4 changes: 2 additions & 2 deletions steam/id.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ def id3(self) -> str:
if self.instance != Instance.Desktop:
instance = self.instance
case Type.Chat:
if self.instance & Instance.ChatClan == Instance.ChatClan:
if self.instance & Instance.ChatClan > 0:
type_char = "c"
elif self.instance & Instance.ChatLobby == Instance.ChatLobby:
elif self.instance & Instance.ChatLobby > 0:
type_char = "L"
else:
type_char = "T"
Expand Down
2 changes: 1 addition & 1 deletion steam/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def __repr__(self) -> str:
@property
def time_remaining(self) -> timedelta | None:
"""The amount of time that this license can be used for."""
if self.flags & LicenseFlag.Expired:
if self.flags & LicenseFlag.Expired > 0:
return
if self.time_limit is None:
return
Expand Down
4 changes: 2 additions & 2 deletions steam/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -2576,7 +2576,7 @@ async def fetch_app_achievements(
self, app_id: AppID, language: Language | None
) -> list[player.GetGameAchievementsResponseAchievement]:
msg: player.GetGameAchievementsResponse = await self.ws.send_proto_and_wait(
player.GetGameAchievementsRequest(appid=app_id, language=(self.language or language).api_name)
player.GetGameAchievementsRequest(appid=app_id, language=(language or self.language).api_name)
)

if msg.result != Result.OK:
Expand All @@ -2590,7 +2590,7 @@ async def fetch_user_achievements(
player.GetAchievementsProgressRequest(
steamid=user_id64,
appids=cast(list[int], list(app_ids)),
language=(self.language or language).api_name,
language=(language or self.language).api_name,
)
)

Expand Down

0 comments on commit e7fbdfc

Please sign in to comment.