Commit 5c01be3d authored by Emil Velikov's avatar Emil Velikov Committed by Alexandros Frantzis

scripts/traceutil.py: bail out when path is missing

Passing non-existing path to os.scan(dir) will crash out.

Avoid that by checking (and appropriately exiting) if the path is
missing. This will result in invalid warning messages being printed as
follow-up, but we can live with that for now.
Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alexandros Frantzis's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
parent c0a54c77
Pipeline #56326 failed with stages
in 5 minutes and 23 seconds
......@@ -10,6 +10,8 @@ def iter_trace_paths(directory):
def trace_has_images(trace_path, imagedir):
tracename = trace_path.name
refdir = str(trace_path.parent / imagedir)
if not os.path.isdir(refdir):
return False
for entry in os.scandir(refdir):
if entry.is_file() and entry.name.startswith(tracename) and entry.name.endswith(".png"):
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment