From 258a9b57cee07a0aca4f812cf8a214c0ff162b98 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 25 Sep 2020 17:42:21 +0200 Subject: [PATCH] release_device should not fail hard if stop_recording or close fail on ConnectionError --- platypush/plugins/camera/pi/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/camera/pi/__init__.py b/platypush/plugins/camera/pi/__init__.py index b4b0f2fcad..1550c44895 100644 --- a/platypush/plugins/camera/pi/__init__.py +++ b/platypush/plugins/camera/pi/__init__.py @@ -84,13 +84,13 @@ class CameraPiPlugin(CameraPlugin): if device.object: try: device.object.stop_recording() - except picamera.PiCameraNotRecording: + except (ConnectionError, picamera.PiCameraNotRecording): pass if device.object and not device.object.closed: try: device.object.close() - except picamera.PiCameraClosed: + except (ConnectionError, picamera.PiCameraClosed): pass def capture_frame(self, camera: Camera, *args, **kwargs):