fix pylint errors

pull/2130/head
Greg Hogan 5 years ago
parent 05c16b1ff9
commit 1e6c7c94e4
  1. 4
      selfdrive/updated.py
  2. 4
      tools/lib/auth_config.py
  3. 4
      tools/lib/logreader.py

@ -283,8 +283,8 @@ def main():
ov_lock_fd = open(LOCK_FILE, 'w') ov_lock_fd = open(LOCK_FILE, 'w')
try: try:
fcntl.flock(ov_lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB) fcntl.flock(ov_lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError: except IOError as e:
raise RuntimeError("couldn't get overlay lock; is another updated running?") raise RuntimeError("couldn't get overlay lock; is another updated running?") from e
# Wait for IsOffroad to be set before our first update attempt # Wait for IsOffroad to be set before our first update attempt
wait_helper = WaitTimeHelper(proc) wait_helper = WaitTimeHelper(proc)

@ -21,8 +21,8 @@ def get_token():
with open(os.path.join(CONFIG_DIR, 'auth.json')) as f: with open(os.path.join(CONFIG_DIR, 'auth.json')) as f:
auth = json.load(f) auth = json.load(f)
return auth['access_token'] return auth['access_token']
except Exception: except Exception as e:
raise MissingAuthConfigError('Authenticate with tools/lib/auth.py') raise MissingAuthConfigError('Authenticate with tools/lib/auth.py') from e
def set_token(token): def set_token(token):

@ -27,8 +27,8 @@ def index_log(fn):
try: try:
dat = subprocess.check_output([index_log, fn, "-"]) dat = subprocess.check_output([index_log, fn, "-"])
except subprocess.CalledProcessError: except subprocess.CalledProcessError as e:
raise DataUnreadableError("%s capnp is corrupted/truncated" % fn) raise DataUnreadableError("%s capnp is corrupted/truncated" % fn) from e
return np.frombuffer(dat, dtype=np.uint64) return np.frombuffer(dat, dtype=np.uint64)
def event_read_multiple_bytes(dat): def event_read_multiple_bytes(dat):

Loading…
Cancel
Save