From 91d50f8ca74a76f34237507db1ad2f17a34da2b2 Mon Sep 17 00:00:00 2001 From: vhristov5555 Date: Wed, 28 Aug 2019 15:37:32 +0300 Subject: [PATCH] Add try catch for process kill. --- core/utils/device/adb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/utils/device/adb.py b/core/utils/device/adb.py index e28ba822..37b0a071 100644 --- a/core/utils/device/adb.py +++ b/core/utils/device/adb.py @@ -59,7 +59,10 @@ def get_logcat(device_id): command_result = Adb.run_adb_command(command='logcat -d', device_id=device_id, wait=False) time.sleep(15) result = File.read(command_result.log_file) - os.kill(command_result.pid, 0) + try: + os.kill(command_result.pid, 0) + except OSError: + Log.info('Process already killed...') return result @staticmethod