Skip to content

Commit

Permalink
change ScriptParamError to Exception
Browse files Browse the repository at this point in the history
(cherry picked from commit 6a6b896)
  • Loading branch information
EraChen233 authored and yimelia committed Dec 26, 2019
1 parent 777ca8c commit 8625b29
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions airtest/aircv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from PIL import Image

from .error import TemplateInputError
from airtest.core.error import ScriptParamError


def generate_result(middle_point, pypts, confi):
Expand Down Expand Up @@ -78,5 +77,5 @@ def compress_image(pil_img, path, quality, max_width=300, max_height=300):
pil_img.thumbnail((max_width, max_height), Image.ANTIALIAS)
quality = int(round(quality))
if quality <= 0 or quality >= 100:
raise ScriptParamError("SNAPSHOT_QUALITY (" + str(quality) + ") should be an integer in the range [1,99]")
raise Exception("SNAPSHOT_QUALITY (" + str(quality) + ") should be an integer in the range [1,99]")
pil_img.save(path, quality=quality, optimize=True)

0 comments on commit 8625b29

Please sign in to comment.