Merge pull request #49 from mullakhmetov/master

Added context manager to file reading
old-commit-hash: db61810f98
commatwo_master
George Hotz 8 years ago committed by GitHub
commit ed1c0d5fec
  1. 3
      common/dbc.py

@ -16,7 +16,8 @@ DBCSignal = namedtuple(
class dbc(object): class dbc(object):
def __init__(self, fn): 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() self._warned_addresses = set()
# regexps from https://github.com/ebroecker/canmatrix/blob/master/canmatrix/importdbc.py # regexps from https://github.com/ebroecker/canmatrix/blob/master/canmatrix/importdbc.py

Loading…
Cancel
Save