forked from mawei/dp
1
0
Fork 0

Added context manager to file reading

This commit is contained in:
Artur Mullakhmetov 2017-01-27 11:33:27 +03:00
parent adaa4ed350
commit 48f203ad5b
1 changed files with 2 additions and 1 deletions

View File

@ -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