forked from platypush/platypush
release_device should not fail hard if stop_recording or close fail on ConnectionError
This commit is contained in:
parent
28409b8688
commit
258a9b57ce
1 changed files with 2 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue