Skip to content

Commit

Permalink
removed TYPE_CHECKING guard
Browse files Browse the repository at this point in the history
  • Loading branch information
A-UNDERSCORE-D committed Aug 6, 2021
1 parent 4724042 commit 2e245f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,9 +1014,8 @@ def parse_entry(self, line: bytes) -> MutableMapping[str, Any]: # noqa: C901, C
for c in entry[changes]:
category = self.category(c['Type'])
name = self.canonicalise(c['Name'])
if TYPE_CHECKING:
# Cheaty "its fine I promise" for TypedDict
category = cast(Literal['Component', 'Data', 'Consumable', 'Item'], category)
# Cheaty "its fine I promise" for TypedDict
category = cast(Literal['Component', 'Data', 'Consumable', 'Item'], category)

if changes == 'Removed':
self.state['BackPack'][category][name] -= c['Count']
Expand Down Expand Up @@ -1407,6 +1406,7 @@ def parse_entry(self, line: bytes) -> MutableMapping[str, Any]: # noqa: C901, C

for category in ('Raw', 'Manufactured', 'Encoded'):
category = cast(Literal['Raw', 'Manufactured', 'Encoded'], category)

for x in entry.get('Ingredients', []):
material = self.canonicalise(x['Name'])
if material in self.state[category]:
Expand Down

0 comments on commit 2e245f6

Please sign in to comment.