Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92be6ee9 authored by jiajia tang's avatar jiajia tang
Browse files

More accurate error if input_file is not exists



This patch is intended to make build log is more
accurate if input_file is not exists, then check if
it is a zipfile.

Change-Id: I30da0141ea44fc3ce0947f868a86a15a054a4346
Signed-off-by: default avatarjiajia tang <tangjiajia@xiaomi.com>
parent 50a00289
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -187,6 +187,9 @@ def ImgFromTargetFiles(input_file, output_file):
  Raises:
    ValueError: On invalid input.
  """
  if not os.path.exists(input_file):
    raise ValueError('%s is not exist' % input_file)

  if not zipfile.is_zipfile(input_file):
    raise ValueError('%s is not a valid zipfile' % input_file)