diff --git a/common/dbc.py b/common/dbc.py index 4414b79839..d333f0a917 100755 --- a/common/dbc.py +++ b/common/dbc.py @@ -16,7 +16,8 @@ DBCSignal = namedtuple( class dbc(object): def __init__(self, fn): - self.txt = open(fn).read().split("\n") + with open(fn) as f: + self.txt = f.read().split("\n") self._warned_addresses = set() # regexps from https://github.com/ebroecker/canmatrix/blob/master/canmatrix/importdbc.py