diff --git a/toolshed/check_generated_file_seals.py b/toolshed/check_generated_file_seals.py index 1a9c45de61b..f81cfa1eb68 100644 --- a/toolshed/check_generated_file_seals.py +++ b/toolshed/check_generated_file_seals.py @@ -17,7 +17,10 @@ assert GENERATED_FILE_MARKER_FRAGMENT in GENERATED_FILE_SEAL_TOKEN _TOKEN_BYTES = GENERATED_FILE_SEAL_TOKEN.encode("ascii") _MARKER_REGEX = re.compile( - rb"^(?P#|\.\.) " + # Keep the alternation in sync with the values of _COMMENT_CHARS below: + # a prefix that is not matched here can never reach the + # expected_comment_prefix() comparison in validate_generated_file_seal(). + rb"^(?P#|\.\.|//) " + re.escape(_TOKEN_BYTES) + rb" format=(?P[0-9]+); content-sha256=(?P[0-9a-f]{64})\n$" )