diff options
author | Maciej Kisielewski <maciej.kisielewski@canonical.com> | 2021-09-21 11:26:10 +0200 |
---|---|---|
committer | Maciej Kisielewski <maciej.kisielewski@canonical.com> | 2021-09-21 11:26:10 +0200 |
commit | 85800b64a184e7bcc93c5a044b74559cee618245 (patch) | |
tree | aeeb7cc3e6de842ad77157418ae9b912836b8894 | |
parent | b6820cf03ac50e6c591536d3cb0aee1e6034e8b9 (diff) |
Fix: graceful exit on no supported camera res
This patch makes the test exit with a graceful message instaed of a backtrace when no supported resolution could be found.
-rwxr-xr-x | bin/camera_test.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/camera_test.py b/bin/camera_test.py index 37e97d9..a7740f4 100755 --- a/bin/camera_test.py +++ b/bin/camera_test.py @@ -248,6 +248,8 @@ class CameraTest: supported_resolutions[key] = set() supported_resolutions[key].add( caps.get_structure(i).get_int('height').value) + if not supported_resolutions: + raise SystemExit("No supported resolutions found!") width = min(supported_resolutions.keys(), key=lambda x: abs(x - self._width)) height = min(supported_resolutions[width], |