mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 20:45:41 +01:00
Pythonify and fix reported line number
Use enumerate to give the line number and use the correct offset to actually calculate it. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
217565ef4e
commit
0ec5979461
@ -246,14 +246,12 @@ class ChangeLog:
|
|||||||
category.name.decode('utf8'))
|
category.name.decode('utf8'))
|
||||||
|
|
||||||
body_split = category.body.splitlines()
|
body_split = category.body.splitlines()
|
||||||
line_number = 1
|
for line_number, line in enumerate(body_split, 1):
|
||||||
for line in body_split:
|
|
||||||
if len(line) > MAX_LINE_LENGTH:
|
if len(line) > MAX_LINE_LENGTH:
|
||||||
raise InputFormatError(filename,
|
raise InputFormatError(filename,
|
||||||
line_offset + category.title_line + line_number,
|
category.body_line + line_number,
|
||||||
'Line is longer than allowed: Length {} (Max {})',
|
'Line is longer than allowed: Length {} (Max {})',
|
||||||
len(line), MAX_LINE_LENGTH)
|
len(line), MAX_LINE_LENGTH)
|
||||||
line_number += 1
|
|
||||||
|
|
||||||
self.categories[category.name] += category.body
|
self.categories[category.name] += category.body
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user