Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjhogan committed Oct 16, 2019
1 parent 5c49fe0 commit 6ba0f47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def _uds_request(self, service_type: SERVICE_TYPE, subfunction: int=None, data:
resp_sfn = resp[1] if len(resp) > 1 else None
if subfunction != resp_sfn:
resp_sfn_hex = hex(resp_sfn) if resp_sfn is not None else None
raise InvalidSubFunctioneError('invalid response subfunction: {}'.format(hex(resp_sfn)))
raise InvalidSubFunctioneError('invalid response subfunction: {}'.format(hex(resp_sfn_hex)))

# return data (exclude service id and sub-function id)
return resp[(1 if subfunction is None else 2):]
Expand Down Expand Up @@ -615,7 +615,7 @@ def dynamically_define_data_identifier(self, dynamic_definition_type: DYNAMIC_DE
for s in source_definitions:
if s["memory_address"] >= 1<<(memory_address_bytes*8):
raise ValueError('invalid memory_address: {}'.format(s["memory_address"]))
data += struct.pack('!I', memory_address)[4-memory_address_bytes:]
data += struct.pack('!I', s["memory_address"])[4-memory_address_bytes:]
if s["memory_size"] >= 1<<(memory_size_bytes*8):
raise ValueError('invalid memory_size: {}'.format(s["memory_size"]))
data += struct.pack('!I', s["memory_size"])[4-memory_size_bytes:]
Expand Down

0 comments on commit 6ba0f47

Please sign in to comment.