Commit 5cd398ff authored by Laurent Peuch's avatar Laurent Peuch
Browse files

fix(cube-licence-date): handle parsing error

parent 2798704136d5
import re
import baron
from datetime import date
from redbaron import RedBaron
......@@ -31,7 +32,12 @@ class UpdateCubeLicenceDates(Command):
old_licence = f"# copyright {match['start']} LOGILAB S.A."
new_licence = f"# copyright {match['start']}-{today_year} LOGILAB S.A."
red = RedBaron(file_content_before)
red = RedBaron(file_content_before)
except baron.parser.ParsingError:
# eh
for target in red("comment", lambda x: x.value.startswith(old_licence)):
target.value = target.value.replace(old_licence, new_licence)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment