Skip to content

Commit

Permalink
hotfix for #381 needs better understanding but works
Browse files Browse the repository at this point in the history
  • Loading branch information
Bröcker committed Aug 5, 2019
1 parent 1ccdb5d commit c7f1a48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/canmatrix/canmatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import canmatrix.copy
import canmatrix.types
import canmatrix.utils
import copy

if attr.__version__ < '17.4.0': # type: ignore
raise RuntimeError("need attrs >= 17.4.0")
Expand All @@ -68,8 +69,8 @@ class J1939needsExtendedIdetifier(ExceptionTemplate): pass

def arbitration_id_converter(source): # type: (typing.Union[int, ArbitrationId]) -> ArbitrationId
"""Converter for attrs which accepts ArbitrationId itself or int."""
return source if isinstance(source, ArbitrationId) else ArbitrationId.from_compound_integer(source)

temp_id = source if isinstance(source, ArbitrationId) else ArbitrationId.from_compound_integer(source)
return copy.deepcopy(temp_id)

@attr.s
class Ecu(object):
Expand Down

0 comments on commit c7f1a48

Please sign in to comment.