# HG changeset patch # User Gregory Szorc # Date 1645472787 25200 # Node ID fe3303436b7980b672690d6cc03ffda633b5d22b # Parent 70df51a2c2ce5202967d528ab21855c051b886d1 tests: remove Python 2 support code Differential Revision: https://phab.mercurial-scm.org/D12350 diff -r 70df51a2c2ce -r fe3303436b79 tests/test-mq-missingfiles.t --- a/tests/test-mq-missingfiles.t Mon Feb 21 12:44:41 2022 -0700 +++ b/tests/test-mq-missingfiles.t Mon Feb 21 12:46:27 2022 -0700 @@ -5,10 +5,7 @@ $ cat > writelines.py < import sys - > if sys.version_info[0] >= 3: - > encode = lambda x: x.encode('utf-8').decode('unicode_escape').encode('utf-8') - > else: - > encode = lambda x: x.decode('string_escape') + > encode = lambda x: x.encode('utf-8').decode('unicode_escape').encode('utf-8') > path = sys.argv[1] > args = sys.argv[2:] > assert (len(args) % 2) == 0 diff -r 70df51a2c2ce -r fe3303436b79 tests/test-mq-qimport.t --- a/tests/test-mq-qimport.t Mon Feb 21 12:44:41 2022 -0700 +++ b/tests/test-mq-qimport.t Mon Feb 21 12:46:27 2022 -0700 @@ -1,9 +1,6 @@ $ cat > writelines.py < import sys - > if sys.version_info[0] >= 3: - > encode = lambda x: x.encode('utf-8').decode('unicode_escape').encode('utf-8') - > else: - > encode = lambda x: x.decode('string_escape') + > encode = lambda x: x.encode('utf-8').decode('unicode_escape').encode('utf-8') > path = sys.argv[1] > args = sys.argv[2:] > assert (len(args) % 2) == 0 diff -r 70df51a2c2ce -r fe3303436b79 tests/test-notify.t --- a/tests/test-notify.t Mon Feb 21 12:44:41 2022 -0700 +++ b/tests/test-notify.t Mon Feb 21 12:46:27 2022 -0700 @@ -2,14 +2,13 @@ > import io > import re > import sys - > if sys.version_info[0] >= 3: - > sys.stdout = io.TextIOWrapper( - > sys.stdout.buffer, - > sys.stdout.encoding, - > sys.stdout.errors, - > newline="\n", - > line_buffering=sys.stdout.line_buffering, - > ) + > sys.stdout = io.TextIOWrapper( + > sys.stdout.buffer, + > sys.stdout.encoding, + > sys.stdout.errors, + > newline="\n", + > line_buffering=sys.stdout.line_buffering, + > ) > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="") > EOF