Skip to content

Commit

Permalink
Us isinstance()
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 committed Aug 15, 2023
1 parent 008b0be commit f5b3b2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion productivity/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async def _parse_set_args(self, data_dict: Optional[dict],
for key, value in to_write.items():
start_address = self.tags[key]['address']['start']
data_type = self.tags[key]['type'].rstrip(digits)
if type(value) == int and data_type == 'float':
if isinstance(value, int) and data_type == 'float':
value = float(value)
if type(value) != pydoc.locate(data_type):
raise ValueError(f"Expected {key} to be a {data_type}.")
Expand Down

0 comments on commit f5b3b2b

Please sign in to comment.