tests/unwrap-message-id.py
author Joerg Sonnenberger <joerg@bec.de>
Wed, 26 Feb 2020 22:26:28 +0100
changeset 44432 a1908951ca42
parent 43334 4128ffba4431
child 48966 6000f5b25c9b
permissions -rw-r--r--
tests: handle In-Reply-To headers for line wrapping Python 3 tends to insert a newline for both Message-ID and In-Reply-To headers, so unwrap both. Just check the wrapped line format explicitly without regular expression. Differential Revision: https://phab.mercurial-scm.org/D8171

from __future__ import absolute_import, print_function

import sys

for line in sys.stdin:
    if line.lower() in ("message-id: \n", "in-reply-to: \n"):
        line = line[:-2]
    print(line, end="")