From 6f199388921f9e0fed6df467c415a534dc6d97f7 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 1 Oct 2020 01:28:43 -0400 Subject: [PATCH] SWDEV-251491 : gen_ostream_ops.py porting to python3 Change-Id: I7081b6ad21b038040267067bd73d8a44df46e4ff [ROCm/roctracer commit: 95626753825d15ece247898fb2acc07b4c40d41f] --- projects/roctracer/script/gen_ostream_ops.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/projects/roctracer/script/gen_ostream_ops.py b/projects/roctracer/script/gen_ostream_ops.py index 73585ce89d..c8f23629ab 100755 --- a/projects/roctracer/script/gen_ostream_ops.py +++ b/projects/roctracer/script/gen_ostream_ops.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os, sys, re import CppHeaderParser @@ -176,9 +176,9 @@ def gen_cppheader(infilepath, outfilepath, structs_depth): process_struct(f, c, cppHeader, "", apiname) global_str = "\n".join(global_str.split("\n")[0:-2]) if structs_depth != -1: #reindent - global_str = string.split(global_str, '\n') - global_str = [' ' + string.lstrip(line) for line in global_str] - global_str = string.join(global_str, '\n') + global_str = global_str.split('\n') + global_str = [' ' + line.lstrip() for line in global_str] + global_str = "\n".join(global_str) f.write(global_str+"\n") if structs_depth != -1: f.write(" };\n") @@ -199,9 +199,9 @@ def gen_cppheader(infilepath, outfilepath, structs_depth): process_struct(f, c, cppHeader, "", apiname) global_str = "\n".join(global_str.split("\n")[0:-2]) if structs_depth != -1: #reindent - global_str = string.split(global_str, '\n') - global_str = [' ' + string.lstrip(line) for line in global_str] - global_str = string.join(global_str, '\n') + global_str = global_str.split('\n') + global_str = [' ' + line.lstrip() for line in global_str] + global_str = "\n".join(global_str) f.write(global_str+"\n") if structs_depth != -1: f.write(" };\n")