From 0a634ca8dae85c35acb67e573e2644c5be4c2357 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Tue, 15 Dec 2020 14:28:33 +0100 Subject: [PATCH] Handle a case when spind doesn't return results --- pyzebra/app/panel_spind.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyzebra/app/panel_spind.py b/pyzebra/app/panel_spind.py index deb691f..6a10e86 100644 --- a/pyzebra/app/panel_spind.py +++ b/pyzebra/app/panel_spind.py @@ -73,8 +73,11 @@ def create(): check=True, ) - with open(os.path.join(temp_dir, "spind.txt")) as f_out: - output_textarea.value = f_out.readlines() + try: + with open(os.path.join(temp_dir, "spind.txt")) as f_out: + output_textarea.value = f_out.readlines() + except FileNotFoundError: + print("No results from spind") process_button = Button(label="Process", button_type="primary") process_button.on_click(process_button_callback)