Skip to content

Commit

Permalink
uses object try for fix #1259
Browse files Browse the repository at this point in the history
  • Loading branch information
Furtif committed Sep 27, 2024
1 parent 0ff90a7 commit bbcc570
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ecu.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,14 @@ def setValue(self, value, bytes_list, dataitem, ecu_endian, test_mode=False):

requestasbin = "".join(requestasbin)

bytes_list = {}
try:
valueasint = int("0b" + requestasbin, 2)
except ValueError:
# this need a break maybe empty and or raise, try empty.
# raise (_("Value of this stuff need a bypass gateway maybe. Value:") + " %s" % requestasbin)
print (_("Value error of this stuff need a bypass gateway maybe. Value:") + " %s" % requestasbin)
return {}
return bytes_list

valueashex = hex(valueasint)[2:].replace("L", "").zfill(numreqbytes * 2).upper()

Expand Down

0 comments on commit bbcc570

Please sign in to comment.