From 5d82a025077322fe024f3670e013d27897a4e680 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Sun, 6 Sep 2020 14:59:12 +0530 Subject: 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 --- osprofiler/hacking/checks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osprofiler/hacking/checks.py b/osprofiler/hacking/checks.py index b31a47d..2723210 100644 --- a/osprofiler/hacking/checks.py +++ b/osprofiler/hacking/checks.py @@ -73,7 +73,10 @@ def skip_ignored_lines(func): line = logical_line.strip() if not line or line.startswith("#") or line.endswith("# noqa"): return - yield next(func(logical_line, filename)) + try: + yield next(func(logical_line, filename)) + except StopIteration: + return return wrapper -- cgit v1.2.1