Skip to content

Commit 7dd6f84

Browse files
authored
[test] Remove some Python 2 logic (#42045)
Found this one. No longer needed.
1 parent 2021a73 commit 7dd6f84

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

test/Incremental/Verifier/gen-output-file-map.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
import sys
1010

1111

12-
# Python 2 `unicode` was renamed `str` in Python 3. To consistently support
13-
# both, define `unicode` to be `str` when using Python 3. Once we can drop
14-
# Python 2 support, delete this and change all uses of `unicode` to `str`.
15-
if sys.version_info[0] >= 3:
16-
unicode = str
17-
18-
1912
def fatal(msg):
2013
print(msg, file=sys.stderr)
2114
sys.exit(1)
@@ -70,13 +63,13 @@ def main(arguments):
7063
}
7164

7265
with io.open(output_path, 'w', encoding='utf-8', newline='\n') as f:
73-
f.write(unicode(json.dumps(all_records, ensure_ascii=False)))
66+
f.write(str(json.dumps(all_records, ensure_ascii=False)))
7467

7568
if args.response_output_file is not None:
7669
with io.open(args.response_output_file, 'w',
7770
encoding='utf-8', newline='\n') as f:
7871
for line in response_file_contents:
79-
f.write(unicode(line + " "))
72+
f.write(str(line + " "))
8073

8174

8275
if __name__ == '__main__':

0 commit comments

Comments
 (0)