mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 12:32:06 +08:00
Merge pull request #49 from mullakhmetov/master
Added context manager to file reading
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