From f771c7231dfcb59fdbc29d44579440f694951982 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 14 Feb 2022 22:06:59 -0800 Subject: [PATCH] fix --- selfdrive/car/car_helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 9d139efced..b4a57179ac 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -1,4 +1,6 @@ import os +from enum import Enum + from common.params import Params from common.basedir import BASEDIR from selfdrive.version import is_comma_remote, is_tested_branch @@ -67,9 +69,7 @@ def _get_interface_names(): try: brand_name = car_folder.split('/')[-1] model_names = __import__(f'selfdrive.car.{brand_name}.values', fromlist=['CAR']).CAR - if brand_name == 'toyota': # TODO: remove exception - model_names = [c.name for c in model_names] - else: + if not issubclass(model_names, Enum): # TODO: remove exception model_names = [getattr(model_names, c) for c in model_names.__dict__.keys() if not c.startswith("__")] brand_names[brand_name] = model_names except (ImportError, OSError):