Skip to content

Commit

Permalink
Added slightly more descriptive exceptions to try/except blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ausshir committed Apr 9, 2017
1 parent 66edd66 commit 67ec02a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyvesc/messages/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(cls, name, bases, clsdict):
cls._field_names.append(field[0])
try:
cls._field_scalars.append(field[2])
except:
except IndexError:
pass
if field[1] is 's':
# string field, add % so we can vary the length
Expand Down Expand Up @@ -79,7 +79,7 @@ def unpack(msg_bytes):
for k, field in enumerate(data):
try:
data[k] = data[k]/msg_type._field_scalars[k]
except:
except (TypeError, IndexError) as e:
pass
msg = msg_type(*data)
if not (msg_type._string_field is None):
Expand Down

0 comments on commit 67ec02a

Please sign in to comment.