diff --git a/hooks/copyright.py b/hooks/copyright.py index 103fef9d0d8e08069239f98b9b7dc32114faf6bb..7a20d409a85a0ec44c8899ecea7e97318bff0c55 100755 --- a/hooks/copyright.py +++ b/hooks/copyright.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2021 Dominik Sekotill +# Copyright 2021, 2022 Dominik Sekotill # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ def get_file_years(paths: List[Path]) -> Dict[Path, str]: cmd.extend(p.as_posix() for p in paths) proc = run(cmd, stdout=PIPE, check=True) - regex = re.compile(br'(?P[0-9]{4,})(?:\n|\r|\r\n)(?P.*?)\x00\x00') + regex = re.compile(br'(?P[0-9]{4,})(?:\n|\r|\r\n)(?P.*?)(\x00\x00|$)') for match in regex.finditer(proc.stdout): year = match.group('year').decode() for path in split_paths(match.group('files')):