mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-02 13:29:30 +08:00
handle conversion exception for LongitudinalPersonality (#28426)
* handle type conversion exception
* catch multiple exception
old-commit-hash: 48b507c0b4
This commit is contained in:
@@ -65,10 +65,9 @@ class LongitudinalPlanner:
|
||||
self.personality = log.LongitudinalPersonality.standard
|
||||
|
||||
def read_param(self):
|
||||
param_value = self.params.get('LongitudinalPersonality')
|
||||
if param_value is not None:
|
||||
self.personality = int(param_value)
|
||||
else:
|
||||
try:
|
||||
self.personality = int(self.params.get('LongitudinalPersonality'))
|
||||
except (ValueError, TypeError):
|
||||
self.personality = log.LongitudinalPersonality.standard
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user