Skip to content
Snippets Groups Projects
Commit 3124735c authored by Guillaume Endignoux's avatar Guillaume Endignoux
Browse files

Use argparse.FileType as suggested in review.

parent ad044972
Branches
No related tags found
No related merge requests found
...@@ -430,8 +430,7 @@ class OpenSKInstaller: ...@@ -430,8 +430,7 @@ class OpenSKInstaller:
]) ])
if self.args.elf2tab_output: if self.args.elf2tab_output:
output = self.checked_command_output(elf2tab_args) output = self.checked_command_output(elf2tab_args)
with open(self.args.elf2tab_output, 'a') as f: self.args.elf2tab_output.write(output)
f.write(output)
else: else:
self.checked_command(elf2tab_args) self.checked_command(elf2tab_args)
...@@ -869,6 +868,7 @@ if __name__ == "__main__": ...@@ -869,6 +868,7 @@ if __name__ == "__main__":
main_parser.add_argument( main_parser.add_argument(
"--elf2tab-output", "--elf2tab-output",
metavar="FILE", metavar="FILE",
type=argparse.FileType("a"),
dest="elf2tab_output", dest="elf2tab_output",
default=None, default=None,
help=("When set, the output of elf2tab is appended to this file."), help=("When set, the output of elf2tab is appended to this file."),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment