mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-08-04 15:56:05 +08:00
Added context manager to file reading
old-commit-hash: 48f203ad5b5f83e53d140d6c36b1ef6637fa9c6c
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user