Skip to content

Commit 7b65e26

Browse files
committed
Added another guard against varying pyang output format.
- Legacy-Id: 10966
1 parent f52e21f commit 7b65e26

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

ietf/submit/checkers.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,21 @@ def check_file_txt(self, path):
142142
if code > 0:
143143
error_lines = err.splitlines()
144144
for line in error_lines:
145-
fn, lnum, msg = line.split(':', 2)
146-
lnum = int(lnum)
147-
if fn == model and (lnum-1) in range(len(text)):
148-
line = text[lnum-1].rstrip()
149-
else:
150-
line = None
151-
items.append((lnum, line, msg))
152-
if 'error: ' in msg:
153-
errors += 1
154-
if 'warning: ' in msg:
155-
warnings += 1
145+
if line.strip():
146+
try:
147+
fn, lnum, msg = line.split(':', 2)
148+
lnum = int(lnum)
149+
if fn == model and (lnum-1) in range(len(text)):
150+
line = text[lnum-1].rstrip()
151+
else:
152+
line = None
153+
items.append((lnum, line, msg))
154+
if 'error: ' in msg:
155+
errors += 1
156+
if 'warning: ' in msg:
157+
warnings += 1
158+
except ValueError:
159+
pass
156160
results[model] = {
157161
"passed": code == 0,
158162
"message": out+"No validation errors\n" if code == 0 else err,

0 commit comments

Comments
 (0)