Fix StopIteration error on Ubuntu Focal

As per victoria cycle testing runtime and community goal,
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

StopIteration error happening in pep8 job when running on Focal.

we can see the failure in https://review.opendev.org/#/c/744331/

Change-Id: Iecdd3bfddb95adec77f8581f844cfc74ca59fc73
Story: #2007865
Task: #402207
This commit is contained in:
Manish Kumar 2020-09-06 14:59:12 +05:30 committed by Ghanshyam Mann
parent 6ff0187d33
commit 5d82a02507
1 changed files with 4 additions and 1 deletions

View File

@ -73,7 +73,10 @@ def skip_ignored_lines(func):
line = logical_line.strip() line = logical_line.strip()
if not line or line.startswith("#") or line.endswith("# noqa"): if not line or line.startswith("#") or line.endswith("# noqa"):
return return
yield next(func(logical_line, filename)) try:
yield next(func(logical_line, filename))
except StopIteration:
return
return wrapper return wrapper