From 3c675b296f9d28646a3c9e96731631a98ffb6359 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 16 Aug 2019 18:49:15 +0200 Subject: [PATCH] Don't propagate the exception if stop_preview failed --- platypush/plugins/camera/pi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/camera/pi.py b/platypush/plugins/camera/pi.py index e0a9f7ae..ab359ed1 100644 --- a/platypush/plugins/camera/pi.py +++ b/platypush/plugins/camera/pi.py @@ -93,7 +93,10 @@ class CameraPiPlugin(CameraPlugin): Stop camera preview. """ camera = self._get_camera() - camera.stop_preview() + try: + camera.stop_preview() + except Exception as e: + self.logger.warning(str(e)) @action def take_picture(self, image_file, preview=False, warmup_time=2, resize=None, **opts):