[Fuego] [PATCH 3/8] Use file descriptor instead of file.write()
[email protected] Wed, 20 Apr 2022 15:41:35 +0530
| Newsgroups | dev.linux.lists.fuego |
|---|---|
| Message-ID | <[email protected]> |
From: Shivanand Kunijadar <[email protected]> Use of file descriptor to write a file is compatible with python2 and python3. Signed-off-by: Shivanand Kunijadar <[email protected]> --- scripts/ovgen.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ovgen.py b/scripts/ovgen.py index faabc62..a6e0f13 100755 --- a/scripts/ovgen.py +++ b/scripts/ovgen.py @@ -375,27 +375,27 @@ def generateProlog(logdir, ofcls, classes, testdir, testspec): name = ofc.name debug_print ("\nwriting %s base class" % (name)) - file.write(outfile, "#class: %s\n" % (name)) + outfile.write("#class: %s\n" % (name)) for var in ofc.vars: outStr = "%s=\"%s\"" % (var, ofc.vars[var]) outStr = outStr.replace('"', '\"') debug_print("%s <- %s" % (outFilePath, outStr)) - file.write(outfile, outStr+"\n") + outfile.write(outStr+"\n") for cap in ofc.cap_list: outStr = "CAP_%s=\"yes\"" % (cap) debug_print("%s <- %s" % (outFilePath, outStr)) - file.write(outfile, outStr+"\n") + outfile.write(outStr+"\n") - file.write(outfile, "\n") + outfile.write("\n") for func in ofc.funcs: body = ofc.funcs[func] debug_print("%s <- %s()" % (outFilePath, func)) - file.write(outfile, body+"\n") + outfile.write(body+"\n") - file.write(outfile, "\n") + outfile.write("\n") ts = parseSpec(logdir, testdir, testspec) generateSpec(ts, outfile) -- 2.20.1