Skip to content
Snippets Groups Projects
Commit 9495d2f2 authored by Guido Trotter's avatar Guido Trotter
Browse files

check-news: fix behavior on invalid date line


Before:
$ ./autotools/check-news < ./NEWS
Traceback (most recent call last):
  File "./autotools/check-news", line 150, in <module>
    main()
  File "./autotools/check-news", line 120, in main
    parsed_ts = time.mktime(time.strptime(m.group("date"), "%d %b %Y"))
AttributeError: 'NoneType' object has no attribute 'group'

After:
$ ./autotools/check-news < ./NEWS
Line 8: Invalid release line

This happened because the error function just updates an error log,
rather than bailing out immediately.

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent 6ad99bc8
No related branches found
No related tags found
No related merge requests found
......@@ -113,6 +113,8 @@ def main():
m = RELEASED_RE.match(line)
if not m:
Error("Line %s: Invalid release line" % fileinput.filelineno())
expect_date = False
continue
# Including the weekday in the date string does not work as time.strptime
# would return an inconsistent result if the weekday is incorrect.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment