From 4ce67683996db69f53ad0f30beee6bd47c079749 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 15 Jul 2019 19:12:58 +0000 Subject: [PATCH] Fixed a bug in check-copyright - Legacy-Id: 16457 --- bin/check-copyright | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/check-copyright b/bin/check-copyright index ca393b781..0e6c0a36c 100755 --- a/bin/check-copyright +++ b/bin/check-copyright @@ -188,6 +188,7 @@ write_cache = False loginfo_format = r'^r[0-9]+ \| [^@]+@[^@]+ \| \d\d\d\d-\d\d-\d\d ' year = time.strftime('%Y') +copyright_re = "(?i)"+opt_copyright.format(years=r"(\d+-)?\d+") for path in files: try: if not os.path.exists(path): @@ -200,8 +201,7 @@ for path in files: date = initinfo[path]['date'] init = date[:4] - copyright_re = "(?i)"+opt_copyright.format(years=r"(\d+-)?\d+") - copyright_year_re = "(?i)"+opt_copyright.format(years=r"({init})?{year}") + copyright_year_re = "(?i)"+opt_copyright.format(years=r"({init}-)?{year}".format(init=init, year=year)) with open(path) as file: try: chunk = file.read(4000)