mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
tools: fix Python 3 issues in inspector_protocol
PR-URL: https://github.com/nodejs/node/pull/29296 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
1 parent
b2cce432f3
commit
4662f67e38
2 files changed
+12
-12
No files matched your search
@@ -21,14 +21,12 @@ def main(argv):
|
||||
parser.add_argument("json_file", help="The .json output file write.")
|
||||
args = parser.parse_args(argv)
|
||||
file_name = os.path.normpath(args.pdl_file)
|
||||
input_file = open(file_name, "r")
|
||||
pdl_string = input_file.read()
|
||||
with open(file_name, "r") as input_file:
|
||||
pdl_string = input_file.read()
|
||||
protocol = pdl.loads(pdl_string, file_name, args.map_binary_to_string)
|
||||
input_file.close()
|
||||
|
||||
output_file = open(os.path.normpath(args.json_file), 'wb')
|
||||
json.dump(protocol, output_file, indent=4, separators=(',', ': '))
|
||||
output_file.close()
|
||||
with open(os.path.normpath(args.json_file), 'w') as output_file:
|
||||
json.dump(protocol, output_file, indent=4, separators=(',', ': '))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in new issue
Block a user