From b3d39a9d2bbaacef3c9da099179b269a655110b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD=20=D0=93=D0=BE=D1=80=D0=B1=D1=83?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Wed, 23 Oct 2024 23:57:35 +0300 Subject: [PATCH] fix locate_on_screen --- src/pygats/pygats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pygats/pygats.py b/src/pygats/pygats.py index b1c34eae..36b6c312 100644 --- a/src/pygats/pygats.py +++ b/src/pygats/pygats.py @@ -334,7 +334,7 @@ def locate_on_screen(ctx: Context, img_path: str): """ try: coord = pyautogui.locateOnScreen(img_path, confidence=0.5) - except pyautogui.ImageNotFoundException: + except (pyautogui.ImageNotFoundException, OSError, TestException): failed(msg='Изображение не найдено') ctx.formatter.print_para(f'Изображение найдено в координатах {coord}') return coord