Skip to content

Commit

Permalink
build: make compress_json python3 compatible
Browse files Browse the repository at this point in the history
This patch replaces a usage of `map` with list comprehension,
which makes the script Python 3 compatiable.

PR-URL: nodejs#25582
Reviewed-By: Refael Ackermann <[email protected]>
(cherry picked from commit b31b84d)
  • Loading branch information
thefourtheye authored and BaochengSu committed Oct 9, 2020
1 parent a383626 commit c9586ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/compress_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

step = 20
slices = (data[i:i+step] for i in xrange(0, len(data), step))
slices = map(lambda s: ','.join(str(ord(c)) for c in s), slices)
slices = [','.join(str(ord(c)) for c in s) for s in slices]
text = ',\n'.join(slices)

fp = open(sys.argv[2], 'w')
Expand Down

0 comments on commit c9586ad

Please sign in to comment.