在之前版本的 pyautogui 中,当找不到图像时,返回值为“None”,所以我过去使用except TypeError:. 但自从更新(版本 0.9.41)以来,它不起作用,因为它返回 ImageNotFoundException,但它不被识别为异常。当我尝试except ImageNotFoundException:这样做时,出现错误:
except TypeError:
except ImageNotFoundException:
[E0712] 捕获不继承自 Exception 的异常:ImageNotFoundException
这个错误应该如何处理呢?
python exception except pyautogui
except ×1
exception ×1
pyautogui ×1
python ×1