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:
|
if device.object:
|
||||||
try:
|
try:
|
||||||
device.object.stop_recording()
|
device.object.stop_recording()
|
||||||
except picamera.PiCameraNotRecording:
|
except (ConnectionError, picamera.PiCameraNotRecording):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if device.object and not device.object.closed:
|
if device.object and not device.object.closed:
|
||||||
try:
|
try:
|
||||||
device.object.close()
|
device.object.close()
|
||||||
except picamera.PiCameraClosed:
|
except (ConnectionError, picamera.PiCameraClosed):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def capture_frame(self, camera: Camera, *args, **kwargs):
|
def capture_frame(self, camera: Camera, *args, **kwargs):
|
||||||
|
|
Loading…
Reference in a new issue