forked from openkylin/platform_build
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: jiajia tang <tangjiajia@xiaomi.com>
This commit is contained in:
parent
50a00289ea
commit
92be6ee9d7
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue