Skip to content

Commit 4ce6768

Browse files
committed
Fixed a bug in check-copyright
- Legacy-Id: 16457
1 parent 44f51c1 commit 4ce6768

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bin/check-copyright

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ write_cache = False
188188
loginfo_format = r'^r[0-9]+ \| [^@]+@[^@]+ \| \d\d\d\d-\d\d-\d\d '
189189

190190
year = time.strftime('%Y')
191+
copyright_re = "(?i)"+opt_copyright.format(years=r"(\d+-)?\d+")
191192
for path in files:
192193
try:
193194
if not os.path.exists(path):
@@ -200,8 +201,7 @@ for path in files:
200201
date = initinfo[path]['date']
201202
init = date[:4]
202203

203-
copyright_re = "(?i)"+opt_copyright.format(years=r"(\d+-)?\d+")
204-
copyright_year_re = "(?i)"+opt_copyright.format(years=r"({init})?{year}")
204+
copyright_year_re = "(?i)"+opt_copyright.format(years=r"({init}-)?{year}".format(init=init, year=year))
205205
with open(path) as file:
206206
try:
207207
chunk = file.read(4000)

0 commit comments

Comments
 (0)