[Py3] fix py3 issue in tools
Bug: v8:9871 Change-Id: I4084771cfc4d34f8e1b9d5265e115f9eac1098d8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2646165 Reviewed-by: Dan Elphick <delphick@chromium.org> Reviewed-by: Michael Achenbach <machenbach@chromium.org> Commit-Queue: Gus Caplan <snek@chromium.org> Cr-Commit-Position: refs/heads/master@{#72293}
This commit is contained in:
parent
b2860adf94
commit
b6ba105467
@ -5,10 +5,15 @@
|
||||
# found in the LICENSE file.
|
||||
|
||||
import argparse
|
||||
from io import BytesIO
|
||||
import os
|
||||
import sys
|
||||
|
||||
if (sys.version_info >= (3, 0)):
|
||||
from io import StringIO
|
||||
else:
|
||||
from io import BytesIO as StringIO
|
||||
|
||||
|
||||
def parse_args():
|
||||
global args
|
||||
parser = argparse.ArgumentParser()
|
||||
@ -60,7 +65,7 @@ def generate_header(out):
|
||||
|
||||
def main():
|
||||
parse_args()
|
||||
header_stream = BytesIO("")
|
||||
header_stream = StringIO("")
|
||||
generate_header(header_stream)
|
||||
contents = header_stream.getvalue()
|
||||
if args.output:
|
||||
|
Loading…
Reference in New Issue
Block a user