From 53ba5f6628feeb2c5ebfee64cba32eb30bca43ec Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 5 Sep 2018 15:29:14 +0000 Subject: [PATCH] Wrap camera stop and connection close in two distinct try-catch blocks --- platypush/backend/camera/pi.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platypush/backend/camera/pi.py b/platypush/backend/camera/pi.py index a8c072993..7c419a015 100644 --- a/platypush/backend/camera/pi.py +++ b/platypush/backend/camera/pi.py @@ -125,11 +125,11 @@ class CameraPiBackend(Backend): self.camera.wait_recording(2) except ConnectionError: self.logger.info('Client closed connection') - try: - self.stop_recording() - connection.close() - except: - pass + try: self.stop_recording() + except: pass + + try: connection.close() + except: pass self.send_camera_action(self.CameraAction.START_RECORDING)